- Home /

# Predict Vector after AngularVelocity applies

I just know this should be straightforward, but I cant find what I need in the objects.

Given a rigidbody which is rotating on the spot. I can get it's angular velocity and its current transform.forward easily enough, but I want a function that will let me rotate transform.forward by (angularvelocity x t) so I can predict what the objects forward vector will be assuming that the same angularvelocity continues to apply for the next t seconds. and, importantly, I want to do it WITHOUT actually rotating the transform. So transform.rotate is out. I want to predict it, not change it.

(Ignore angular drag for the moment, I just want a simplest case.)

I think I'm just missing the right Vector3 function or something but I get confused because angularvelocity is a vector not a quaternion.

Any help is appreciated

**Answer** by robertbu
·
Jun 26, 2013 at 06:44 PM

This is untested but should work:

```
var v3NewForward = Quaternion.Euler(rigidbody.velocity * t) * transform.forward;
```

't' is the time in seconds.

Perfect thankyou. I knew it would be something simple, but I didn't realise you could multiply a quaternion and a vector with a simple * operator.

Also, in case anyone else comes across this. It's worth bearing in mind that rigidbody.angularvelocity is in radians but rigidbody.addtorque and quaternion.euler take their parameters in degrees!

Radians. It would be nice for the script reference to mention this.

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.

### Follow this Question

### Related Questions

eliminating angular velocity when clamp value hit? 0 Answers

Calculate Angular Velocity to Match Remote Position 0 Answers

Flip over an object (smooth transition) 3 Answers

Aligning a transform according to two different positions and directions 1 Answer

What factors have an affect on the AddRelativeTorque()? 0 Answers