playMaker

Author Topic: Get / Set Position Lag  (Read 3807 times)

NinjaBear

  • Playmaker Newbie
  • *
  • Posts: 6
Get / Set Position Lag
« on: August 29, 2013, 08:07:52 PM »
Hey,  First time poster.  I usually scour through the posts to find a solution but this one is killing me....

I have a Player moving around and a Camera Prefab (Cam and Parent) using get and set position... it seems to work fine until you move the character around and notice a jittering effect (seems like the camera is trying to catch up by a fractional amount)... is there a bug? or a better action to use instead, tried a lot of the itween actions with the same effect.  Just need a smoother result..  any tips


thanks in advance

NinjaBear

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Get / Set Position Lag
« Reply #1 on: August 29, 2013, 08:18:19 PM »
ok,  i just built and ran the game and the jittering is now minimal to none, is this just a unity thing?

NinjaBear

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Get / Set Position Lag
« Reply #2 on: September 02, 2013, 04:06:04 PM »
after looking at a lot of camera C# scripts, found nice smoothdamp command.  Does that exist inside of Playmaker?  Just trying different cam setups to avoid this jittering
« Last Edit: September 02, 2013, 04:58:27 PM by NinjaBear »

redikann

  • Full Member
  • ***
  • Posts: 174
Re: Get / Set Position Lag
« Reply #3 on: September 02, 2013, 05:18:35 PM »
I started with a get/set setup and I also had jitter. Eventually started using get game object position and using that vector3 with 'Itween Move Update'. then use the vector position for an offset. I don't have jitters now.

NinjaBear

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Get / Set Position Lag
« Reply #4 on: September 02, 2013, 07:01:47 PM »
how do you use the vector3 variable for an offset?

* Get Position - PlayerLocation (saved as vector3) (World)
* ITween Move Update - PlayerLocation ( Vector Position) (Self)

Is this the setup or am i missing the offseting?

redikann

  • Full Member
  • ***
  • Posts: 174
Re: Get / Set Position Lag
« Reply #5 on: September 02, 2013, 07:59:57 PM »
Sorry, that was a little misleading. You don't actually need to worry about the get property. The Itween update is the key here.
Your camera is probably parented to an empty that follows your player. Just use your player as the TransformPosition  gameobject variable. Then you can use the vector position as an offset. Click the tab beside vector position to manually enter a float. You may need to adjust the Y input to position the camera at any height .
I leave time at 1 and uncheck orient to path.

NinjaBear

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Get / Set Position Lag
« Reply #6 on: September 02, 2013, 08:17:27 PM »
way less jitter, but still a tiny bit, no jitter almost on build and run.  no get position seems to have done the trick, thanks... now to get started on the occlusion fix for the camera

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get / Set Position Lag
« Reply #7 on: September 11, 2013, 03:36:03 AM »
Hi,

 I think you are facing a commong issue. you need to have your camera or the actual yobject that follows your player to use "LateUpdate" instead "update", else you will always get jittering, because the rendering engine is out of synch with your code ( it's a known fact when using physics objects)

Can you tell me more about your camera prefab setup and what technic /actions you use to follow your player?

bye,

 Jean