V
V
Vanya Petilo2019-04-26 22:06:39
C++ / C#
Vanya Petilo, 2019-04-26 22:06:39

How to set AddForce in local coordinates?

There is a certain game model. "Jet engines" are attached to it. The model, as is clear from the question itself, must move using AddForce (physics realism is very important, I don’t plan to use translate).
When using Vector3 as it is - the force is given relative to world, global coordinates.

void FixedUpdate()
    {
        rb.AddForce(new Vector3(-1, 0) * thrust);
    }

How to convert vector to local coordinates? Or is there another way to specify specifically local coordinates?
5cc356a79026b456317369.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Pogrebnyak, 2019-04-26
@mr_garther

Rigidbody.AddRelativeForce

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question