- Home /
FPS player animation state, networked
Probably simple, but I'm new to this: I've got an FPS multiplayer, and I want to set the walk/idle/etc anim states on the players over the net. Currently (with apparently no consideration for network), if my 'local' player is walking, all connected players will 'walk' too. Other players can move all they want but never leave the initial 'idle' state on my (server/host) copy.
Is it as simple as adding a NetworkView? And/or do I need to send the anim name string around?
Any tutorials or examples you might point me to would be great.
Answer by appels · Jul 01, 2010 at 10:15 PM
you can set a networkview to watch the animation or use rpc's.
I already have a NetworkView to sync position/orientation. Would I another one, or use the same one? It's watching a script....
Ok I tried the RPC, no luck. Doing something wrong?
[code]
function Update() { ......
if (lastAnim != anim || lastSpeed != speed)
{
networkView.RPC ("SetPlayerAnim", RPC$$anonymous$$ode.Others, anim);
}
}
@RPC function SetPlayerAnim (anim : String) { Debug.Log("got me an anim "+anim); go.animation.CrossFade (anim); }
[/code]
I never see the remote player's anim change, I never see the debug msg in the console.
yes, add another networkview and set it to watch the animation and then try again. This is my rpc : @RPC function DoAnimation(actionName : String) { if(!networkView.is$$anonymous$$ine) animation.wrap$$anonymous$$ode = Wrap$$anonymous$$ode.Loop; animation.CrossFade(actionName); }
I pass the wanted animation in the rpc and it gets played on the remote character.
Still no luck. I guess I'm unclear as to what you mean 'set it to watch the animation' How is that done?
Perhaps I should be watching the FPSWalker script? Would I need to expose the speed and stuff on that?
Answer by berserker · Sep 06, 2010 at 01:23 PM
i have same problem and i dont know how to solve this problem. Just i dont have animation. When i my player moving, other player moving too. if i switch to other client player refreshed and moving to original position. Can anyone help me to solving this problem?
Best regards.
Your answer

Follow this Question
Related Questions
Animation not showing when close up 1 Answer
Mecanim animation over network - uLink 0 Answers
Lerping Field Of View is buggy 1 Answer
C# Cant get correct speed value from gameobject 0 Answers
gun bob and jerk animation 2 Answers