make a "S" movement for an actor

jerlant360jerlant360 Member Posts: 82
edited September 2012 in Working with GS (Mac)
Hi guys i would like to put a "S" movement for one of my actors falling from the top , how can i make that?

Thanks :D

Comments

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

    @jerlant360

    Hi, the following equation is courtesy of @firemaplegames for a sine wave back and forth:

    halfWaveHeight * sin( timeFactor * oscillationSpeed) + centerOfWave

    So if you wanted your actor to move downwards in an "s" movement, you'll need to add velocity with a negative number.

    Change Attribute self.Motion.Linear Velocity.Y to -170 ------ as an example value
    Constrain Attribute self.Position.X to 100*sin(self.Time*200)+340
    ---- again with values as examples only
  • jerlant360jerlant360 Member Posts: 82
    ooohh man thats awesome Thanks!!!!!! hahahhaha :D :D :D
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    You're welcome. :-)
Sign In or Register to comment.