- Home /
Multiplayer prefab spawns with wrong orientation
I'm testing multiplayer with Smartfox. For this I'm adapting the Island demo. I now got it working in third person view and replaced the frog (Lerpz) with the construction worker model from the standard assets.
Now I'd like the remote players to also spawn as the construction worker, but the model always spawns on its side (he's floating on his back) and does not animate. I attached the same scripts and defined the animations. I think it might have something to do with this line that spawns the remote player, but the scripting manual is very limited on Quaternion (it says not to modify this directly...).
UnityEngine.Object remotePlayer = Instantiate(remotePlayerPrefab, new Vector3(-10000, -10000, -10000), new Quaternion(0,0,0,1));
What would I have to change to get the orientation correct? Any pointers for fixing the animation are also welcome ;-)
Answer by WhiskeyJack · Nov 03, 2010 at 03:36 PM
I kinda solved this (still very new with characters, objects and animation). Turned out I did not use the right (parent) component for the remote player. When I used the "Constructor" object (under Standard Assets > Character Controllers > Sources > PrototypeCharacter) the orientation was correct. Previously I tried with "construction_worker and "Bip001" that both have "Constructor" as a parent.
I think I could not get the orientation right the first time because the rotations I tried were applied to the parent game object and not the model (and I couldn't figure out how to fix that in a timely manner).
Solved the animation part now as well. Originally the demo works with the FPS walker script. Because I switched to a 3rd person view with the corresponding script, the "Sendmessage" commands that are in the FPS walker scripts were no longer being fired. After adding these to the 3rd person script, for example SendMessage("PlayAnimation", "walk"); the animations are playing :-) Still flickers when the player is idle though.
i have my animations attached to player controller script for multiplayer fps.. how can every player in the network can see those animations..its really annoying for me with very little knowledge of sending animation across network..any help