I Bounce through the ceiling

Hello. I am experiencing a bug while adding the bounce mushroom, Player flying through the ceiling (platforms layer).

Wondering what could prevent this situation.

Hi

Is your ceiling on the same tilemap as your ground ?

Also worth checking your rigidbody/collider mesh has no gaps in it

Yes.

I’ve checked it as well. I think it is simply a bug caused by speed limit overthrown

is there any option to fix it? I’v been facing it as well, but in the lecture, rick doesn’t have that same problem

I dont remember if the code was inside fixedupdate or update. Try out fixedupdate otherwise

could you say which code? I’d appreciate it

Just replace Update() with FixedUpdate() in your script where character movement is specified. Not sure if it will work though

no, it does not work mate, Thanks for the suggestion though :slight_smile:

Hi!

The reason why your character keep getting through colliders, it’s probably because it is way too fast for the physics tick to accurately detect it, to fix that try setting your Rigibody2D’s Collision Detection property to Continuous.

If this doesn’t work, then you’ll have to play around with the terrain colliders. 2D collisions are a little buggy when dealing with colliders that are “hollow”, like the edge collider or the composite collider when setting its Geometry Type to Outlines. Try setting it to Polygons instead.

Keep in mind that both solutions demand more from your CPU, but don’t worry too much about it, as long as you don’t have a hundred rigidbodies set to continuous, you won’t see a difference in performance.

ohh Thank you.

Privacy & Terms