Drag Select Isn't Functional on Clients

Hi there! So, problem - one my client the drag select doesn’t work - I can click + shift click for multiple unit selection, and the green selection square successfully renders on screen, but nothing will be selected. Serverside drag selection works fine. I’ve noticed when I run the client on the editor neither of the Player object’s unit lists populate when new units are made, but I’ve gone back to double check that the actions & methods for adding units to lists were correctly implemented (for both server and client) and they were, so I’m a little stumped!

tl/dr drag box selection won’t work on client, suspect issue with clientside MyUnits list

Hi there,

The first thing I suggest checking is the event subscriptions in the RTSPlayer, it is a common mistake to copy and paste these and forget to change the spawn to despawn or the -/+. Then it can mess with adding units to the list.

Unit.AuthorityOnUnitSpawned += AuthorityHandleUnitSpawned;
Unit.AuthorityOnUnitDespawned += AuthorityHandleUnitDespawned;


So! Turns out it was a very embarrassing mistake - I went to check the event subscriptions on RTSPlayer and realized I was removing units to myUnits on UnitSpawn, and adding them on despawn, so I just entered the methods backwards. Thanks for the help! Works just fine now.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms