playMaker

Author Topic: Variable call 0 before the right value[SOLVED]  (Read 1727 times)

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Variable call 0 before the right value[SOLVED]
« on: December 27, 2013, 12:35:01 PM »
hi,

i get a strange behavior with one of my script,

i made a camera, following on object and go back to the player.
and because i need a specific camera position at the end, i modify it after with a ease float.

so i get this:

Smooth look at Player
Get Position Camera Y,Z
Get Rotation Camera X
Ease Position Camera Y
Ease Position Camera Z
Ease Rotation Camera X
Set Position camera Y,Z
Set Rotation Camera X

nothing really complicate, i use 1var Global for each + 1 var for each so the first give the start of easing, and the second is updated each frame.

the process works but when the camera start easing, it start at O for each variable and 2 or 3 frames later get the right value to start.

how can i solve this problem ?
« Last Edit: December 31, 2013, 07:59:34 AM by blackant »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Variable call 0 before the right value
« Reply #1 on: December 30, 2013, 07:42:57 AM »
Hi,

 It's simply because "smooth look at" does it's job on "Late update" to take in account physics based positioning and the rest of the actions you use only work son regular updates, so you will have this annoying lag.

 No real solution but just put more easing or get position and rotation during the lateupdate too ( which mean custom actions).

Bye,

 Jean

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Re: Variable call 0 before the right value [SOLVED]
« Reply #2 on: December 31, 2013, 07:59:13 AM »
Ok, Thanks Jean, I remplaced Ease Float by Interpolate and it solved the problem