I’m trying to create Arwing-like controls, in that my player is always moving forward relative to its rotation, and it can be rotate along any axis (Yaw, pitch, roll).
I have tried applying a rigidbody and converting my code (See the verbose commented out lines for my failures) yet, weird stuff would happen, like moving along the wrong axis, having to rotate things in my prefab to appropriate for inverted axis, crazy jazz. I really, really need collisions to happen though.
Here is my code:
//rb.AddRelativeForce(Vector3.up * (speed + boostHolder));
//rb.MovePosition(Vector3.forward * (speed + boostHolder));
transform.Translate(forward * (speed + boostHolder));
transform.Rotate(Input.GetAxis("Vertical")* turnspeed, Input.GetAxis("Horizontal") * turnspeed, ((Input.GetAxis("Horizontal") / 3) * -1) + Input.GetAxis("Roll") * -turnspeed);
//rb.AddTorque (Input.GetAxis("Vertical") * turnspeed, Input.GetAxis("Horizontal") * -turnspeed,0);
//transform.Rotate(vfloat * turnspeed, Input.GetAxis("Horizontal") * turnspeed, ((Input.GetAxis("Horizontal") / 3) * -1) + Input.GetAxis("Roll") * -turnspeed);