Relative Content

Tag Archive for c#unity-game-enginemultiplayer

Unity OnNetworkSpawn not called?

I created a GameObject with a NetworkObject component and attached a script to manage the state of a collider based on the server’s status. The script is designed to enable the collider when the server is detected. However, the function responsible for this behavior does not appear to be executing, and no log messages are being shown.
Here is the script

Unity OnNetworkSpawn not called?

I created a GameObject with a NetworkObject component and attached a script to manage the state of a collider based on the server’s status. The script is designed to enable the collider when the server is detected. However, the function responsible for this behavior does not appear to be executing, and no log messages are being shown.
Here is the script

Why can’t I turn right and move forwards with two characters at once?

I’m a beginner to unity and just copied the code from someone so I don’t fully understand it, but I don’t understand what’s wrong. I am making a small game with two players. The only code I have is making the characters move, but here is the problem: when I press to move forward and right at the same time with both characters, the last input simply won’t work. It only happens with those two directions.