CmdSetTarget Not Working

This was asked here. I tried that users method and it didn’t work for me.

For some reason, everything is working but CmdSetTarget isn’t executing. I’ve used Debug.Log in the foreach loop in TryTarget function and it’s definitely running and target is definitely not null. Everything is set up in the inspector correctly.

EDIT: I think I figured it out. Whenever I built the game I’d use that to host the server and connect the Unity Editor as the client. I switched this around and it was working correctly. If I’m understanding this correctly the script is being run on the server even though it’s called on the client. So whenever I connected the Unity Editor as the client it’s not seeing the changes being made.

1 Like

Hi there, if my understanding is correct, you are saying that CmdSetTarget is running on the Server, but you are not seeing the results on the Client? This would imply that the behaviour isn’t syncing. Could this be the issue? Maybe your units are missing the Network Transform Component? Which part specifically isn’t happening on the Client?

Privacy & Terms