# Using Quaternion.Slerp WITH continuous user input? (not cliche question, I swear)

So, I know this is an old topic and so… but I am not able to find the answer anywhere!

Here is the deal…

I have an object rotating, according to user input… if I just go

`````` objectToRotate.transform.RotateAround(new Vector3(0f, 20f, 0f), __auxVec, _rotationSensitivity * Time.fixedDeltaTime);
``````

where Vector3(0f, 20f, 0f) is just a point to rotate around, and __auxVec is where I get user input save into, I get a really choppy, jittery movement.

So apparently, the deal is using Quaternion.Slerp… the dealt is that the last argument for this call, is t, where it is a time incremente, corresponding from 0 to 1…

Well, I don’t feel this is a right thing to do when I am getting input at each frame, since I will have T to be always the same value… so my question is: is there another way to deal with t? How do I stop this jittering and make some smooth rotation for my simple primitive object?

If there’s user input why are you slerping? Slerps are typically used for transitions or animations. If you want rotation based on user input and you want it to be responsive then just poke your input (along with any scaling necessary) straight into your rotation function of choice.

Also, if this is mouse input, don’t multiply it by a time factor. Mouse movement as an input already has time factored into it, since it takes time to make the movement, as opposed to a joystick (or whatever) where holding a direction represents movement over time.

Also, t is not a time increment. It’s an interpolation factor, where 0 is the first of the two values you entered and 1 is the second.

I hope something there helps!

Dear Mr. Penguin

Being my rotation function of choice the transform.RotateAround() one, do you have any idea of why it is not smooth? It is not a matter of being too fast… but you know that feeling when it appears that some frames are being jumped?

I really dunno how to get that pretty smooth look to that

well, apparently removing the deltaTime from there did get a better result… anything else for me?

Is it in Update() or FixedUpdate()? Update() may be smoother for user input, because it’s run once per frame, where FixedUpdate() is run at fixed timesteps which may not line up with frames (so it may be called multiple times in a frame or not at all).

Actually, I am doing that through FingerGestures (the plugin) callbacks… should not? o.O I don’t think I like you anymore dude haha