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
34
S
8
G
7
Posts: 498
Reputation: 7,753

Post » Tue Jan 17, 2012 8:28 pm

If you give it the sine behavior it should do the trick
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Tue Jan 17, 2012 8:30 pm

Doh... lol

Thanks. and solved.
B
34
S
8
G
7
Posts: 498
Reputation: 7,753

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
247
S
85
G
40
Posts: 7,000
Reputation: 57,805

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
29
S
12
G
7
Posts: 740
Reputation: 7,849


Return to How do I....?

Who is online

Users browsing this forum: ETgirl79 and 14 guests