Hi,
You could use "Float Changed"
but i think it is better to use every frame and and set the animator float every frame.
Hello, still didn't manage to make it work. It's working right now half on Playmaker the other half with the script. Any way you guys could show me how to translate the below code to Playmaker FSMs (this is what's missing and I don't know how to translate and I have lost too many hours trying to)?
void FixedUpdate () {
float horizontal = Input.GetAxis ("Horizontal");
float vertical = Input.GetAxis ("Vertical");
if (cam != null) {
camForward = Vector3.Scale (cam.up, new Vector3 (1, 0, 1)).normalized;
move = vertical * camForward + horizontal * cam.right;
} else {
move = vertical * Vector3.forward + horizontal * Vector3.right;
}
if (move.magnitude > 1) {
move.Normalize();
}
Move (move);
Vector3 movement = new Vector3 (horizontal, 0, vertical);
}
void Move(Vector3 move){
if (move.magnitude > 1) {
move.Normalize ();
}
this.MoveInput = move;
ConvertMoveInput ();
UpdateAnimator ();
}
void ConvertMoveInput (){
Vector3 localMove = transform.InverseTransformDirection (MoveInput);
xAmount = localMove.x;
zAmount = localMove.z;
}
void UpdateAnimator (){
anim.SetFloat ("Z", zAmount, 0.1f, Time.deltaTime);
anim.SetFloat ("X", xAmount, 0.1f, Time.deltaTime);
}