- Home /
Send an Animation through photon network
Whats wrong here? yes i've linked the animation to the inspector. just dont play the animation on others player
variable pv = photonview
void Update()
{
if (pv.isMine){
InputMovement();
playerMesh.SetActive(false);
if(Input.GetKey (KeyCode.W) && Input.GetKey (KeyCode.A) && Input.GetKey (KeyCode.S) && Input.GetKey (KeyCode.D)) {
motor.movement.maxForwardSpeed = walkSpeed;
motor.movement.maxSidewaysSpeed = walkSpeed;
motor.movement.maxBackwardSpeed= walkSpeed;
pv.RPC ("WalkAnimation", PhotonTargets.Others);
}
else if(Input.GetKey (KeyCode.LeftShift)) {
motor.movement.maxForwardSpeed = runSpeed;
motor.movement.maxSidewaysSpeed = runSpeed;
motor.movement.maxBackwardSpeed = runSpeed;
pv.RPC ("RunAnimation", PhotonTargets.Others);
}
else {
motor.movement.maxForwardSpeed = walkSpeed;
motor.movement.maxmaxSidewaysSpeed = walkSpeed;
motor.movement.maxBackwardSpeed= walkSpeed;
pv.RPC ("IdleAnimation", PhotonTargets.Others);
}
}
else {
playerMesh.SetActive(true);
}
}
[RPC]
void WalkAnimation() {
playerAnimation3rd.CrossFade ("WalkAnimation");
}
[RPC]
void IdleAnimation() {
playerAnimation3rd.CrossFade ("IdleAnimation");
}
[RPC]
void RunAnimation() {
playerAnimation3rd.CrossFade ("RunAnimation");
}
Comment
Your answer
Follow this Question
Related Questions
Animation via Photon Networking without Animator 0 Answers
Problem with animation RPC in Photon 1 Answer
Sync animaor of child prefab 0 Answers
Animation does not work for the remote player 0 Answers
Lan on photon 1 Answer