Problem with animations
Options
Ruslan
✭
in Photon Bolt
In a single mode this script works correctly, But when I test the connection nothing works.
What could be the problem?
using UnityEngine;
using System.Collections;
public class PlayerAnimka : Bolt.EntityBehaviour {
public override void Attached() {
state.transform.SetTransforms(transform);
state.SetAnimator(GetComponent());
state.Animator.applyRootMotion = entity.isOwner;
}
public override void SimulateOwner() {
if (Input.GetKey (KeyCode.W)) {
// Just play the animation if you press the W key
state.Walk = true;
} else {
state.Walk = false;
}
}
}
What could be the problem?
using UnityEngine;
using System.Collections;
public class PlayerAnimka : Bolt.EntityBehaviour {
public override void Attached() {
state.transform.SetTransforms(transform);
state.SetAnimator(GetComponent());
state.Animator.applyRootMotion = entity.isOwner;
}
public override void SimulateOwner() {
if (Input.GetKey (KeyCode.W)) {
// Just play the animation if you press the W key
state.Walk = true;
} else {
state.Walk = false;
}
}
}
0
Comments
-
Answered this in email, you added this to the Player prefab in the Advanced Tutorial, this will not work because its incompatible with authoritative networking. I recommend either going through the advanced tutorial or checking out the "clientAuthTPC" for a simpler, non authoritative way of networking that will let you do things the way you are doing in the aforementioned script.0
-
Hi,
I don't know if my issue is related to the same problem, but I used the tutorial from the web site and replaced the robot by another character.
I use the (exemple:) state.Run = true; in the SimulateOwner() method to activate the run. But sometimes, the animation doesn't play (character slides in idle mode). I've added a debug info to see if the variable is set correctly and yes, it is good.
So I was wondering if that was a network replication issue (bad configuration on my side, or wrong setup, etc.), or something else.
Thanks!
0 -
Its probably an issue with your mecanim transitions, impossible to say for sure without seeing the project.0