Constraining Platforms Left/Right Movement to Screen Display

jasdipjasdip Member, PRO Posts: 7
Hi,

I am trying to constrain a platform I have moving left and right to the screen display. I can get it to work using change velocity and self position > and < rules.

However, I would like to get the platform movement using sin which would make things a little cleaner and efficient. Currently I have the following formula below for the left and right movement, but any advice on what I need to put into the formula to constrain the platform so it does not go off the screen would be appreciated.

Constrain Attribute
Self.Position.X to Sin(Self.Time*100)*100

thank you

Jason

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited December 2012



    AAA*Sin(Self.Time*BBB)+CCC

    AAA = range of movement.
    BBB = speed of oscillation.
    CCC = centre of movement.





Sign In or Register to comment.