toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
GameSalad 101
›
Working with GS (Mac)
actor going side to side
yasoofx
Member
Posts:
332
October 2013
in
Working with GS (Mac)
Does Anyone know how I can make an actor go side to side in a linear way, like a specific place to a specific place
Answers
UtopianGames
Member
Posts:
5,692
October 2013
edited October 2013
You could use interpolate and make a simple loop.
If position X=100 interpolate to 400 and if position X=400 interpolate to 100.
I always use equals or greater than for the 400 and equals or less than for 100 just incase it misses a beat.
Project attached.
Darren.
Socks
London, UK.
Member
Posts:
12,822
October 2013
If you want the actor to 'dampen' into it's left and right position (so it doesn't jerk when it changes direction) you can use this:
Constrain self position X to: 200*cos( game.Time *200)+ 284
Socks
London, UK.
Member
Posts:
12,822
October 2013
Like this . . . .
Sign In
or
Register
to comment.
Answers
If position X=100 interpolate to 400 and if position X=400 interpolate to 100.
I always use equals or greater than for the 400 and equals or less than for 100 just incase it misses a beat.
Project attached.
Darren.
Constrain self position X to: 200*cos( game.Time *200)+ 284