- Home /
How do i move CharacterController toward the direction its facing?
I have a problem with my CharacterController, i already succeed move(forward) the character and rotate it, but i want to the character rotate then when i move it, it'll move forward to the direction its facing
Here's the code for the move
public void Forward(float vertical_input){
float forwardSpeed = vertical_input * speed;
if(isGrounded)
movement = new Vector3 (myBody.velocity.x, 0, forwardSpeed);
movement = transform.TransformDirection (movement);
myBody.SimpleMove (movement);
}
when i rotate the character then move it, the character went to the side (left, right). Before i apply the TransformDirection the character move forward toward its position although i had rotate it. I'm still beginner in Unity, so i don't know much how to handle this, thank you
Your answer
Follow this Question
Related Questions
How to rotate instantated prefab without rotating it's local directions by javascript? 1 Answer
How do I move a CharacterController type in the direction it's facing? 1 Answer
Jaggie, uneven speed with basic movement script. 0 Answers
Bouncing Ball Problem( bounces vertically forever) 1 Answer
Rotation and Velocity of bullets. 1 Answer