Constraining Platforms Left/Right Movement to Screen Display
jasdip
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
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
AAA*Sin(Self.Time*BBB)+CCC
AAA = range of movement.
BBB = speed of oscillation.
CCC = centre of movement.