- Home /
CommandAttribute ( [Command] ) Limitations?
I am trying to use a CommandAttribute to communicate the spawning of a given prefab at a point and rotation. Thus far I have discovered that
1) Using a prefab game object reference will not work. The server receives null from the client for that parameter.
To solve that I switched my Cmd funtion to take the Resources relative path of the prefab instead.
2) Passing a Quaternion rotation as a parameter does not work? The server seems to always receive this as 0 0 0 1
I can probably change this to use euler if need be but wondering what other kinds of limitations are there for parameters and the CommandAttribute?
Answer by Alturis2 · Sep 23, 2016 at 05:16 AM
Never mind I figured out what was going on. The server spawned the GameObject but the prefab in question was not setup to replicate the transform with the Network Transform... so i guess the starting position gets replicated by default but it not updated with new rotation info after that.
I will try and implement with with a pair of Command and ClientRpc calls instead.
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
Local multiplayer networking - Howto 3 Answers
What is Send rate? 1 Answer
Network.sendRate = 50; is that bad? 0 Answers