If somone can help me this code is for a joystick and i want when i move the to the left or the right to rotate Code (csharp): using System.Collections; using System.Collections.Generic; using UnityEngine; public class JoystickControler : MonoBehaviour { public float speed; public Joystick Joystick; public Rigidbody rb; public void FixedUpdate() { Vector3 direction = Vector3.forward * Joystick.Vertical + Vector3.right * Joystick.Horizontal; rb.AddForce(direction * speed * Time.fixedDeltaTime, ForceMode.VelocityChange); } } Ps. I 4 month's ago i started using unity
There's nothing in this code about rotation. If you want to use the physics system to rotate you apply torque instead of applying a force. There's lots of other ways of applying a rotation as well. Check out the answers here for more ideas. https://answers.unity.com/questions/1441242/how-can-i-rotate-rigidbody-and-not-violate-physics.html