I’m trying to make a sort of booster-style function where you’re instantly forced forward and up when the function is called. Since I wanted the process to be generally abrupt and not gradual, I didn’t want to use rigidbody.AddRelativeForce, but I can’t seem to figure out how to directly add to velocity in a way that affects it locally/relatively. I want it to force me forward based on my rotation, not along the world’s Z axis.
There have been a lot of questions about relative velocity, and the answer seems to be “use Vector3.Dot” or “use transform.InverseTransformDirection”. I don’t know how to add to velocity locally by using those functions, however. It seems those who were posting questions about it only wanted to get your relative velocity, not add to your relative velocity.
I would prefer using velocity over AddRelativeForce, since AddRelativeForce is gradual and very hard to accurately control.
Also, I know the documentation says not to edit velocity directly, but I don’t think that applies to me, as all I really use rigidbodies for is gravity (everything else physics-related is Translate-operated) and don’t ever add force/torque in situation. Of course, feel free to correct me if I’m wrong here and it really will cause some kind of glitchy, unstable physics.
Hopefully this doesn’t sound too much like a “write my script” question…I just really can’t figure out how to go about this.
Thanks for any help you can offer!