How do you make a sprite stand on fast moving platforms?

Get help using Construct 2

Post » Wed Jan 20, 2016 2:23 am

How do you make a sprite whit the platform behavior be able to stand on fast moving platforms? When my player sprite land on a fast moving platform they either fall trough it or just get pushed away in some way. You can also make the platform really big to make the player be able to stand on them but i don't want every fast moving platform to be really big and like whit sides it doesn't work all the time either.
Last edited by Calfuso on Wed Jan 20, 2016 4:06 pm, edited 1 time in total.
B
11
S
2
Posts: 262
Reputation: 1,309

Post » Wed Jan 20, 2016 10:30 am

Cant you just pin it when it lands on the platform ?
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180

Post » Wed Jan 20, 2016 3:28 pm

That works in some instances but in some other instances i want my player to be able to move when it is on the platform.
B
11
S
2
Posts: 262
Reputation: 1,309

Post » Wed Jan 20, 2016 3:31 pm

You could unpin the player when you want to move?

Another way would be to clamp the players x-position to the platforms boundingbox left and right if overlapping at offset..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jan 20, 2016 4:10 pm

This post is empty becuase the thing i wrote here doesn't matter anymore.
B
11
S
2
Posts: 262
Reputation: 1,309

Post » Wed Jan 20, 2016 4:38 pm

Calfuso wrote:This post is empty becuase the thing i wrote here doesn't matter anymore.


Why not just delete your post?

The 'X' in the post header allows you to delete your own posts.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
129
S
29
G
74
Posts: 5,143
Reputation: 52,691

Post » Wed Jan 20, 2016 5:09 pm

I'm not used to working with the platforming behaviour, but wouldn't something like this work:

(if only moving along x)
player is on platform: set player.x to player.x + platform.speed * dt

This should overlap your other movement. It you want the player to carry over momentum from jumping off the platform, you'd need to add some code for it, too.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Wed Jan 20, 2016 5:55 pm

I said that pinning the player to the platform works in some instances but it really doesn't. The player can land on the platform and stand on it fine but it it can't jump off it most fo the time and it often falls through it when it changes animation and the player needs to be able to jump off the platform and switch animations on it. So i need another solution both for the player to be able to stand onthe platform still and move on the platform.
B
11
S
2
Posts: 262
Reputation: 1,309

Post » Wed Jan 20, 2016 7:39 pm

Calfuso wrote:I said that pinning the player to the platform works in some instances but it really doesn't. The player can land on the platform and stand on it fine but it it can't jump off it most fo the time and it often falls through it when it changes animation and the player needs to be able to jump off the platform and switch animations on it. So i need another solution both for the player to be able to stand onthe platform still and move on the platform.


Pinning should work just fine if you do it the right way..
On any moving key pushed first unpin and then simulate the behaviour and you're ok..

The other idea I gave was using the clamp, which should still work, or try the above solution by mindfaq..
So there's already three possible ways described in this thread, need more?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: dzert14, JaisonAntoniazzi, NetOne, Solomon and 10 guests