Collisions and Platypus (SOLVED)

Hello all,

I hope that everyone is doing well!

I had a quick question about collisions. I am using platypus to control the character movement and collisions. I have inclined collision boxes, they are ramps. When the character jumps up on the ramp it does not walk up it, rather through it on the same plane it was initially on. How can I make it so that it walks up the ramp rather than through?

Thanks!
V

does the ramp collision has enough height y? thanks

Hey, thanks for your response.
The collision box is high enough, the issue arrises when I try to have the player walk up the ramp. it doesn’t, rather it walks through…

Do you mean a rectangle at an angle? I think Platypus only supports non rotated rectangle collisions.

As I remember, the Platypus’ characher has a rectangle collider. I believe that the leg’ body in physic based games should be represents as a circle. And rorate circle with pivot joint aka wheel is ideal.
Btw, a visual example should helps to understand the problem.

Ok, this is good to know. With this being the case, do you know of any workarounds or solutions?

Here is a clip of the character going through the collision rather than walking up, any ideas?

pill_watertight.zip (287 Bytes)

Here is a watertight pill 2d shape useful for platformers like this using the Box2d physics for collisions.

Kinematic bodies dosn’t resolve collisions by itself, see:

But it should works in Platypus from the box?

Yes, Platypus resolves the collisions.

Platypus uses ray casts to handle most of the collision detection. You need to configure the rays to match the size of the collision shape. You can visualize the ray casts by enabling the debug value when calling platypus.create(). You configure the rays from the collisions table in the config. More here:

2 Likes

I have had the rays configured and they are the same size as the collision box. I checked out the grottoscape example to try and see if there is anything about it that allows for the player to walk up ramps but I cant find anything. Is there any code or anything else I may be missing?

The issue might be that the platforms are not applying any upward force, I am not seeing the upward arrows, only downward arrows, in the debug.

Edit: the player can walk up a ramp if it is a tile, but not a regular gameobject with a regular collision box.

Thanks! I’ll look into this!

Also to clarify, I’m not seeing any directional arrows in the debug like in the grottoscope example.

@Vgreen can you share your project with me (bjorn@defold.se)?

Thanks, Invited that email to the github repo!

The spot I am mainly looking at is the branch right above where the character spawns, you can double jump to get on it, for some reason the character can’t walk up it.

Thanks again!

Oh, please send the invite to GitHub user britzl. The email I wrote is not associated with a GitHub account.

My apologies, I have shared it to the correct user now!

1 Like

I’ve transitioned from using collision shapes to ray casts for all collision detection as that is a lot more reliable. I’ve also made several changes to the implementation and slopes is now working (as long as they are not too steep).

Please try the new version: https://github.com/britzl/platypus/releases/tag/4.0.0

5 Likes

Thank you! I looked into this and it worked great!

Sorry for the late reply, my family and I went on holiday!

Thanks again for the help!

2 Likes