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
36
S
8
G
8
Posts: 541
Reputation: 8,429

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: 7,994

Post » Tue Jan 17, 2012 8:30 pm

Doh... lol

Thanks. and solved.
B
36
S
8
G
8
Posts: 541
Reputation: 8,429

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
276
S
103
G
84
Posts: 7,288
Reputation: 83,091

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: 7,994


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, RealMagisterLudi and 10 guests