Platform behaviour - slipping off platform edges

Just started using Construct 2? Post your questions here

Post » Tue Mar 17, 2015 12:24 am

Hello.

I'm using the platform behaviour with acceleration and deceleration set insanely high, 100000000000000, to simulate a kind of binary movement; either players move full speed or they don't move at all. No easing in or out. Works fine except if my characters land right at the edge of a platform they'll slip off it sometimes. That's not good. I need them to stay on the platform if they connect with it. None of this slippery slope business please. Has anyone else had this problem? Is there a way to fix it?
B
32
S
13
G
2
Posts: 492
Reputation: 5,040

Post » Tue Mar 17, 2015 10:43 am

Why not just set the speed to 1000000000000 and back to 0 ?

The sliding happens due to deceleration.
Who dares wins
B
53
S
13
G
11
Posts: 1,757
Reputation: 13,828

Post » Tue Mar 17, 2015 2:07 pm

@lennaert Thanks for the reply :) It's a good guess but it doesn't seem to be what causes the problem.

If I set acceleration and deceleration to 0 when IsOnFloor is triggered then the object will slide along the platform until it either falls off the other side or hits a wall. That's to be expected obviously, but it'll *still* slide off the edge it lands near to in some cases. I'll post a couple of images to illustrate the problem better:

Image

Player jumps:
Image

And sometimes land just long enough to trigger IsOnFloor but *doesn't stay on the platform*:
Image

Acceleration/deceleration set to 0 on IsOnFloor:
Image
B
32
S
13
G
2
Posts: 492
Reputation: 5,040

Post » Tue Mar 17, 2015 5:02 pm

I have not seen this before, perhaps your able to provide a sample capx ?
Who dares wins
B
53
S
13
G
11
Posts: 1,757
Reputation: 13,828

Post » Wed Mar 18, 2015 11:52 am

I think I figured it out. I had been resizing collision on the collision object to roughly fit with the sprite object animation so when the object landed the collision hull itself got resized. I removed that and it seems to work no problem now. Sometimes I wonder if my brain is too small for game development :P

Thanks for helping out :)
B
32
S
13
G
2
Posts: 492
Reputation: 5,040


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests