Discuss Scratch

timo1os
Scratcher
100+ posts

is it possible to fix this bug?

so bassically, long time ago, i explored a bug which if you go to a corner your player get stuck and game gets very laggy and then eventually crashes. I have fixed bug like few months ago and updating the project constantly. then I found this bug again but now I don't really understand why it does this.
I have added alot of mechanics these past months and the code is now VERY MESSY which caused it I cant fix the bug.
So any fix to this bug?
the project:https://scratch.mit.edu/projects/404479350/
the physics engine is based on griffpatch tutorial project but as since I've added alot of mechanics and for these mechanics I used detection which changes the position and hitboxes

I know I worked on it so hard but its soo messy so maybe its better to rewrite the player character code from scratch?

Last edited by timo1os (June 5, 2021 21:11:12)

Thingied
Scratcher
1000+ posts

is it possible to fix this bug?

(if you aren't talking about sliding then correct me)
Try changing the script to this:

I'm kind of lazy but I do have a theory about why it happens. It changes into a hitbox that's inside a wall so the sprite is going to try to get over it but it can't because of the edge.

Last edited by Thingied (June 5, 2021 23:01:47)

timo1os
Scratcher
100+ posts

is it possible to fix this bug?

Thingied wrote:

(if you aren't talking about sliding then correct me)
Try changing the script to this:

I'm kind of lazy but I do have a theory about why it happens. It changes into a hitbox that's inside a wall so the sprite is going to try to get over it but it can't because of the edge.
im talking about that there is a bug when i touch a corner while crouching (use C) i get stucked
edit: it also sometimes happens when im not crouching but less often

Last edited by timo1os (June 7, 2021 13:10:43)

Thingied
Scratcher
1000+ posts

is it possible to fix this bug?

timo1os wrote:

Thingied wrote:

(if you aren't talking about sliding then correct me)
Try changing the script to this:
-snip-
I'm kind of lazy but I do have a theory about why it happens. It changes into a hitbox that's inside a wall so the sprite is going to try to get over it but it can't because of the edge.
im talking about that there is a bug when i touch a corner while crouching (use C) i get stucked
edit: it also sometimes happens when im not crouching but less often
My theory is that you just keep going up and up because it repeats forever so we have to limit how many times it can do that. Try this:

The dimensions of hitbox 10 should be like this:

Powered by DjangoBB