How do you make an up and down motion using interpolate?
ShortAxe5
Member, PRO Posts: 69
I've searched numerous forums and have not yet found my answer.
Someone please help me
Comments
Hi @ShortAxe5 I'm surprised you never found any info on that - your question is one of those "old chestnuts" to a degree, asked many times...
For interest, there's 2 or 3 more ways to achieve the same result you're after. Here's a straightforward way using Interpolate behaviours, as you asked:
Let's say you want the actor starting at 100 Y coordinate, and finish on 250 Y. Put into the actor's Rule:
Rule: When self.Position.Y = 100
Interpolate self.Position.Y to 250
Rule: When self.Position.Y = 250
Interpolate self.Position.Y to 100
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Isn't it usually slightly safer to have Y <= 100 or >= 250 in case somehow it gets pushed past the max spot?
@Tosanu, yes. I always do ≥ or ≤.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
@Tosanu @jamie_c Good thinking, guys, thanks. (Although personally I've never had a problem but it's a good safeguard for sure..)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
@gyroscope
Thank you