playMaker

Author Topic: Jerky camera with quaternion slerp  (Read 2954 times)

MattBradley

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Jerky camera with quaternion slerp
« on: October 27, 2015, 01: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:


And my actions are as follows:


Anyone have any ideas?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15060
  • Official Playmaker Support
    • View Profile
Re: Jerky camera with quaternion slerp
« Reply #1 on: October 27, 2015, 03: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.


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

 Bye,

 Jean

MattBradley

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Jerky camera with quaternion slerp
« Reply #2 on: October 27, 2015, 11:20:54 AM »
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?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15060
  • Official Playmaker Support
    • View Profile
Re: Jerky camera with quaternion slerp
« Reply #3 on: October 28, 2015, 04:55:42 AM »
Hi,

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

 Bye,

 Jean

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2487
  • Yup.
    • View Profile
    • Cleverous
Re: Jerky camera with quaternion slerp
« Reply #4 on: October 28, 2015, 08: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.

MattBradley

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Jerky camera with quaternion slerp
« Reply #5 on: October 29, 2015, 12: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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15060
  • Official Playmaker Support
    • View Profile
Re: Jerky camera with quaternion slerp
« Reply #6 on: October 29, 2015, 10:48:21 PM »
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

MattBradley

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Jerky camera with quaternion slerp
« Reply #7 on: November 04, 2015, 12:27:26 AM »
Thanks Jean!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15060
  • Official Playmaker Support
    • View Profile
Re: Jerky camera with quaternion slerp
« Reply #8 on: November 04, 2015, 05:57:25 AM »
Hi,

 so that worked?

 Bye,

 Jean