Making platforms you can fall through in a platformer [SOLVED]

I’m currently using Platypus for a platformer game. I’ve set up collisions so that there are one-way platforms you can move up through, but now I need to be able to move back down through that platform.

Right now Platypus doesn’t support this, so I’d need to roll my own solution. But where would I get started with this functionality?

The only thing I’ve tried right now is disabling the one-way collision group in Platypus to let me fall through for a short time, but doing so breaks the whole thing. I’m not sure what my next step is.

Hello. I didnt quite understand and i don’t know what kind of collision you are using in the platform, but you can disable collision in order to “move back”. Look it up.

I’ve tried that too, but Platypus uses its own collision detection, so even if you disable the collision object, you’ll still be using the collision managed by Platypus, so nothing happens.

In case it’s not clear, the “Platypus” I keep referring to is a library for platformer features: https://github.com/britzl/platypus

I’ve decided to remove the one-way collision group from Platypus to use my own collision separation. Thanks to this link I’ve been able to add some basic separation for one-way platforms.

Here’s my current code:

elseif message_id == hash("contact_point_response") then

	if message.other_group == hash("oneway") and
	message.normal == vmath.vector3(0, 1, 0) and
	message.distance < self.climb_speed * 0.017 then  -- 0.017 is slightly larger than dt at 60 FPS
		self.platypus.gravity = 0
		local newpos = go.get_position() + message.normal * message.distance
		go.set_position(newpos)
	end
		
end

It’s not perfect, but it works reasonably well. Even though this is technically solved, I’d love to hear some other solutions.

3 Likes