How do you make an up and down motion using interpolate?

ShortAxe5ShortAxe5 Member, PRO Posts: 69

I've searched numerous forums and have not yet found my answer.

Someone please help me :/

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited July 2014

    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

  • TosanuTosanu Member, PRO Posts: 388

    Isn't it usually slightly safer to have Y <= 100 or >= 250 in case somehow it gets pushed past the max spot?

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    @Tosanu, yes. I always do ≥ or ≤.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    @Tosanu @jamie_c Good thinking, guys, thanks. :smile: (Although personally I've never had a problem but it's a good safeguard for sure..)

  • ShortAxe5ShortAxe5 Member, PRO Posts: 69

    @gyroscope‌
    Thank you

Sign In or Register to comment.