PlayMaker Help & Tips > PlayMaker Help

accuracy of transform

(1/3) > >>

elvis75k:
I've been working for the last couple of days on a 2d platform.
I've read about accuracy of float number and the related issues that characterize the precision.
Now i've discovered that it will be impossible for me to move an elevator from point a=0 to point b=20 using animated variables (float animation, ease animation, curves etc). It will always reach random values near the expectations (b=19.21191 or b=20.12288). It has to be precise but it fail for ever and ever; i see a lot of things that cannot understand and i don't know how to make my choises.

1) how can i reach point a=0 to point b=20 in n seconds without having floating surprises?
2) what's the real purpose of having both speed and time in some actions?
3) What if i want to change an action to run in fixedUpdate or in lateUpdate. I don't understand how Playmaker handle their functions.. the Translate action has the option to switch to LateUpdate and the tooltip says things that i don't understand (i've read that changing this will eventually helps in case of jitter ).

iTween: looks like the option that make me possible to have accuracy of transorm but when used on object with rigidbody that interact with others physics elements results in a jitter crazy movement.
Animation: this work just fine but i want to achieve movement with variables.. is the key of the game i'm making.
Thanks in advance, elvis

justifun:
Maybe you could have your elevator automatically round up if it gets within 1 unit of your destination then pop to that position.

elvis75k:

--- Quote from: justifun on April 19, 2012, 06:44:50 PM ---Maybe you could have your elevator automatically round up if it gets within 1 unit of your destination then pop to that position.

--- End quote ---
Do you mean to use set position as a finished event to force the elevator to stay at b=20?
IN THE MEANTIME
I've added a fload clamp to clamp the moveUP var from 0 to 20; added an ease float that goes from -1 to 21  and a translate that move the elevator in Y with moveUP values. The value is definitely clamped but the translation continues till the animation float -> finish event is called (exit the state). Is this normal?

justifun:
 Do you mean to use set position as a finished event to force the elevator to stay at b=20?[/quote]

Yes.  I know its not an ideal solution, just thinking off the top of my head as a possible work around.  If Alex chimes in, i'm sure he'll know a more technical playmaker solution.

elvis75k:
I can't pass this :( It start to turn into pain/headache.

Navigation

[0] Message Index

[#] Next page

Go to full version