 # Thread: can someone check my expression - it's not working as i expect

1. ## can someone check my expression - it's not working as i expect

I'm using the expression to shuffle an active across x.
X( "Start" ) + ( ( X( "End" ) - X( "Start" ) ) * EaseTimer( "Active 3" ) / EaseDuration( "Active 3" ) * 1.0 )
X( "Start" )=100
X( "End" )=500
EaseTimer( "Active 3" )=0-100 with 1 being added each cycle
EaseDuration=100
I expect that as the EaseTimer increases from 0 to 100 the active would slide between 100 and 500. in reality it waits in the 100 position until it hits 500 and then jumps. Can anyone tell me where it went wrong?

I also used the easing object with this formula:

EaseInBetween( "Easing Object", PreviousSatellite_X_15( "Val_Planets" ), SelectedSatellite_X_9( "Val_Planets" ), 1, JumpTimer( "Player" ) / JumpDuration( "Player" ) * 1.0 )

which works in html but fails in the preview mode.
Small Example easeTest.mfa
and link to how it should work http://johnhenderson.com.au/Worlds  Reply With Quote

2. ## Equation convert to float solution Originally Posted by JohnArtbox I'm using the expression to shuffle an active across x.
X( "Start" ) + ( ( X( "End" ) - X( "Start" ) ) * EaseTimer( "Active 3" ) / EaseDuration( "Active 3" ) * 1.0 )
X( "Start" )=100
X( "End" )=500
EaseTimer( "Active 3" )=0-100 with 1 being added each cycle
EaseDuration=100
Thanks to @Yves , I now know that the correct formula is:
X( "Start" ) + ( ( X( "End" ) - X( "Start" ) ) * EaseTimer( "Active 3" )* 1.0 / EaseDuration( "Active 3" ) )

You need to convert the integer into a float before it is divided, otherwise it will convert an integer division into a meaningless float at the end. in my case the answer varied between 0 and one, so having the float(*1.0) at the end meant the equation napping between 0 and 1.  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•