Discuss Scratch

Masterscratch1117
Scratcher
500+ posts

Clipping through walls

I'm working on a platformer, and I've been alerted to a bug. If you slide at a wall and spam left and right you can clip through the wall. I think I know the root of the issue. The walking script checks if you are in a wall and then shoves you out of it in the opposite direction of the way you were walking. The slide gets you in the wall and the input in the opposite direction causes the code to shove you through. I do not know how to fix this issue. LINK:https://scratch.mit.edu/projects/890823892
Masterscratch1117
Scratcher
500+ posts

Clipping through walls

shoving this to the top, because it got buried after forums crashed
standing_rake
Scratcher
55 posts

Clipping through walls

It's you again! There are a couple ways to do this. The first (and probably the best and easiest) is to prevent the player from clipping into the wall to begin with. This could be done by checking if the player would be in the wall before they move, and if so, then don't move. Also, you might want to add
whenclickedforeveriffloortype=groundandtouchingedge?thenstopall
just for testing so when ever you clip into the wall, your game doesn't slow down and maybe crash. You can remove it when you post the final version.
Masterscratch1117
Scratcher
500+ posts

Clipping through walls

no, that won't work, when you hold down and a direction then press the opposite direction while against a wall you clip through. the solution you said would not work at all with my code. please look inside before suggesting a solution. I do now have an idea though so ill report back
Masterscratch1117
Scratcher
500+ posts

Clipping through walls

pushing to the top as i do not have a solution at all and still need help

Powered by DjangoBB