Answer the question
In order to leave comments, you need to log in
How can you implement movement along the walls of the tunnel in a normal way?
Like now I did this, but it all depends on the dummy on which the character is. I turn it, the character turns. The problem is that if the tunnel turns, the character will fly out of it. And in general, it's somehow very difficult, you need to put the dummy in the middle of the tunnel, and the player on the surface of the tunnel.
Video
Hierarchy:
The code is on the Player object:
void FixedUpdate ()
{
transform.position += transform.right * Time.fixedDeltaTime * force;
Vector3 acceleration = Input.acceleration;
transform.Rotate(new Vector3(acceleration.x * sidewaysForce * Time.fixedDeltaTime,0,0));
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question