Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: MattBradley on October 27, 2015, 04:19:59 AM

Title: Jerky camera with quaternion slerp
Post by: MattBradley on October 27, 2015, 04:19:59 AM
Hi there,

I'm having a bit of trouble getting my camera to rotate smoothly.

I'm trying to get it to constantly rotate to the players rotation, but with a slight delay so it feels like its being pulled a little by the player. In the scene view it looks perfect, but in the game view there is a really bad stuttering when the player reaches what appears to be the camera extents. It's like the camera can't update its position fast enough to keep smoothing.

I made a little gif to show what I mean:
(http://i.giphy.com/l41lK5QklbG2QgIZa.gif)

And my actions are as follows:
(http://i.imgur.com/IVWHvtx.png)

Anyone have any ideas?
Title: Re: Jerky camera with quaternion slerp
Post by: jeanfabre on October 27, 2015, 06:02:09 AM
Hi,

 you are getting the rotation on regular update, you need to use a new action I just created on the Ecosystem GetRotationAdvanced (http://hutonggames.com/playmakerforum/index.php?topic=11538.0).


Try with this one and set it to fixed update too.

 Bye,

 Jean
Title: Re: Jerky camera with quaternion slerp
Post by: MattBradley on October 27, 2015, 02:20:54 PM
Hey Jean,

Thanks for the reply and action! I've just tried it out and I'm still seeing the same problem.

Set rotation is likely happening outside of fixed update, could that be it?
Title: Re: Jerky camera with quaternion slerp
Post by: jeanfabre on October 28, 2015, 07:55:42 AM
Hi,

 yes, there is this one too. Make it on late update and try.

 Bye,

 Jean
Title: Re: Jerky camera with quaternion slerp
Post by: Lane on October 28, 2015, 11:34:22 AM
Its still probably glitchy even with Set Rotation in Late Update. Fixed Update is intermittently between Updates so waiting for Update to finish may help but probably isn't necessarily going to smooth it out.

Isn't there a Set Rotation Advanced with the toggle for operating in FixedUpdate? Both in Fixed would be ideal.
Title: Re: Jerky camera with quaternion slerp
Post by: MattBradley on October 29, 2015, 03:31:12 AM
Lane's right, even in late it still has some stuttering. It's better when ran in standalone, but I figure that's to do with a higher, more consistent framerate than anything else.
Title: Re: Jerky camera with quaternion slerp
Post by: jeanfabre on October 30, 2015, 01:48:21 AM
Hi,

 Ok, I made a SetRotationAdvanced action ( On the Ecosystem). Try this one set to FixedUpdate.

 these jerky bugs are all solveable, it's simply because of the decoupled physics engine update and the Unity own update, so there is always a way to get a smooth results without relying on stable fps, which is unreliable.

Bye,

 Jean
Title: Re: Jerky camera with quaternion slerp
Post by: MattBradley on November 04, 2015, 02:27:26 AM
Thanks Jean!
Title: Re: Jerky camera with quaternion slerp
Post by: jeanfabre on November 04, 2015, 07:57:25 AM
Hi,

 so that worked?

 Bye,

 Jean