How to make a platform move up and down?

Get help using Construct 2

Post » Tue Jan 17, 2012 8:15 pm

Hi guys.

I cant seem to figure out how to make a platform move up and down. in a small area. How is this done?

I tried custom movement. But i couldnt find a way.

Any help would be nice!
B
37
S
9
G
8
Posts: 541
Reputation: 8,554

Post » Tue Jan 17, 2012 8:28 pm

If you give it the sine behavior it should do the trick
B
30
S
13
G
7
Posts: 740
Reputation: 8,044

Post » Tue Jan 17, 2012 8:30 pm

Doh... lol

Thanks. and solved.
B
37
S
9
G
8
Posts: 541
Reputation: 8,554

Post » Tue Jan 17, 2012 8:34 pm

For references there are quite a few examples involving the platformer plugin/platformer game mechanics listed in the How do I FAQ.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
294
S
117
G
96
Posts: 7,313
Reputation: 71,094

Post » Tue Jan 17, 2012 8:39 pm

Or if your a more advanced user, you could have to collision boxes. then have a event like this:

system.OnStartOfLayout
     -> Platform.setY(lerp(self.y, collsion1.y, 0.5*dt)

Platform.OnCollisionWith[collision1]
     -> -> Platform.setY(lerp(self.y, collsion2.y, 0.5*dt)

Platform.OnCollisionWith[collision2]
     -> -> Platform.setY(lerp(self.y, collsion1.y, 0.5*dt)

Something like that should do the trick
B
30
S
13
G
7
Posts: 740
Reputation: 8,044


Return to How do I....?

Who is online

Users browsing this forum: Kyatric and 30 guests