Does not attack when the build file is a server

RTS player script is weird.

In the last lesson, multiple units were selected by dragging, but now the size of the List returns 0 even if multiple units are selected by dragging.

Could this be a hint to the problem I’m having right now?

Yes, most likely directly related.
Adding those subscription statements in OnStartClient() should fix it. See my comment above.

The code has already been added and tested.

It is this part that I have my doubts about.

If the player’s list is 0, dragging does not work normally, but shooting works normally.

On the other hand, the current problematic part recognized 2 object counts in the scene, and the list of object counts returned 0 in the build file.

That makes sense I think. If you are running the client in the editor, the client’s list will have 2 units and but the server’s list will have 0. If you are running the server in the editor, the server list will be populated, but the client list will not.

Oh… I understood

We don’t really understand each other’s words and situations.

As shown in the video, when the editor is the client, the list of both player objects is 0.

I’ll just follow the video from the beginning again and check if there’s anything missing.

Sorry I was not more help, you can download the code for each lecture under the resources section for that lecture. Then you could continue from where you left off.

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

Privacy & Terms