Wall-clipping collision issue

I have an issue with the collision system in my project. This is for an A-level computing project so I can’t use the built in physics that the engine offers so I had to code in my own.
When the character jumps but also moves across into the wall of the tilemap the character doesn’t fall along the wall but clips on top of a tile in the wall. Does anyone know how to amend this issue?
image
code for my character that relates to the issue
constants and variables


update function
image
collision function and on message function

jump functions
image
on input function
image

Yes, this is an super common issue and has come up dozens of times:


Good explanation:

You’re better off using raycasts for platforming collisions rather than collision shapes. Check it out here:


There are also a few platforming assets in the Asset Portal that use raycasts to solve this problem. Maybe try studying them a little bit to learn how they work if you’d rather implement it yourself:

6 Likes

My recommendation would be to use a different PNG for the collision shapes with completely square tiles for the walls instead of the irregular ones tracing the outline of the vines etc.