Is modify transform in OnStateUpdate function impossible?
I have been trying to create a state machine character controller. And not even the simplest "characterController.transform.position += Vector3.forward" will take place. I can move my character with characterController.Move(), I cant rotate him though.
I just want to confirm if it is impossible. If it is, I'll be implementing my own state machine. (unwillingly)
Answer by Riiich · Mar 18 at 08:00 PM
https://docs.unity3d.com/ScriptReference/StateMachineBehaviour.html
According to the example script you can use
public class ExampleScript : StateMachineBehaviour
{
override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
Debug.Log("On Attack Update ");
}
}
to have a custom OnStateUpdate
Your answer
Follow this Question
Related Questions
First person controls for GoogleCardboard 2 Answers
Cant Move towards Right and Jump at same time? 2 Answers
Gyro camera control with forward and backward movement 1 Answer
how to move a gameobject based on a dice roll 1 Answer
What is the correct way to move objects relative to each other ? 1 Answer