Discuss Scratch

Guest_102233
Scratcher
100+ posts

Character clips when wall-jumping corner

The problem is at this game. It is an XY scrolling platformer.

While tinkering the slope detection, I found that I can clip through the ceiling by wall-jumping a wall near it.
I also can clip through the ceiling at the little tunnel nearby.

So if I'm correct, it might be the slope and wall detection that's freaking out. But I don't know why.
Central Control Sprite has references if needed.


| My Profile | Highlight my entire signature and press CTRL+SHIFT+Down to scroll down long signatures |
To make your signature (like this), go here: https://scratch.mit.edu/discuss/settings/PutYourUsernameHere/


if <<quick? :: #965B01> and <dog <lazy? ::  #965B01> :: #984723>> then
jump over x:( dog (x):: #984723) y:(dog(y):: #984723):: #112233
end
Guest_102233
Scratcher
100+ posts

Character clips when wall-jumping corner

bumpy road brings rage

| My Profile | Highlight my entire signature and press CTRL+SHIFT+Down to scroll down long signatures |
To make your signature (like this), go here: https://scratch.mit.edu/discuss/settings/PutYourUsernameHere/


if <<quick? :: #965B01> and <dog <lazy? ::  #965B01> :: #984723>> then
jump over x:( dog (x):: #984723) y:(dog(y):: #984723):: #112233
end
MathPuppy314
Scratcher
500+ posts

Character clips when wall-jumping corner

I was too lazy to go through all your code, but I think the slope detection is the problem. When you hit a wall, the sprite jumps up a small amount as if it were testing for a slope. Wherever you do this operation, you need to immediately move back down until you hit the ground.

...
change y by (slope::grey)::grey
if <not <touching [level v] ?>> then
repeat until <touching [level v] ?>
change y by (-1)
end
change y by (1)//you may or may not need this depending on how your project is set up
end
...

Last edited by MathPuppy314 (Oct. 20, 2021 00:01:25)



If only I were a kumquat…
Guest_102233
Scratcher
100+ posts

Character clips when wall-jumping corner

MathPuppy314 wrote:

I was too lazy to go through all your code, but I think the slope detection is the problem. When you hit a wall, the sprite jumps up a small amount as if it were testing for a slope. Wherever you do this operation, you need to immediately move back down until you hit the ground.

...
change y by (slope::grey)::grey
if <not <touching [level v] ?>> then
repeat until <touching [level v] ?>
change y by (-1)
end
change y by (1)//you may or may not need this depending on how your project is set up
end
...


Thanks! I used the code (but suitable for my engine) and it didn't work, so I turned it into a slope test reset and it worked!
...
if <touching [hitbox v]> then
bunch of code :: #888888
else
set [XVEL v] to (0)
repeat until <touching [hitbox v]
change y by (8)
end
end
...

| My Profile | Highlight my entire signature and press CTRL+SHIFT+Down to scroll down long signatures |
To make your signature (like this), go here: https://scratch.mit.edu/discuss/settings/PutYourUsernameHere/


if <<quick? :: #965B01> and <dog <lazy? ::  #965B01> :: #984723>> then
jump over x:( dog (x):: #984723) y:(dog(y):: #984723):: #112233
end
NotGuest_102233
Scratcher
25 posts

Character clips when wall-jumping corner

Turns out it didn't work, it did somewhat reinforce the glitch. The problem in LECF is in PRIZM because I transferred most of the assets from LECF to PRIZM. The slope script is still the same. You can ask for more information. +bump

This account is @Guest_102233's Alt account.
Guest_102233
Scratcher
100+ posts

Character clips when wall-jumping corner

bumpel

| My Profile | Highlight my entire signature and press CTRL+SHIFT+Down to scroll down long signatures |
To make your signature (like this), go here: https://scratch.mit.edu/discuss/settings/PutYourUsernameHere/


if <<quick? :: #965B01> and <dog <lazy? ::  #965B01> :: #984723>> then
jump over x:( dog (x):: #984723) y:(dog(y):: #984723):: #112233
end
NotGuest_102233
Scratcher
25 posts

Character clips when wall-jumping corner

bumpelbumpel

This account is @Guest_102233's Alt account.
NotGuest_102233
Scratcher
25 posts

Character clips when wall-jumping corner

bumpelbumpelbumpel

This account is @Guest_102233's Alt account.
Guest_102233
Scratcher
100+ posts

Character clips when wall-jumping corner

bumpelbumpelbumpelbumpel

| My Profile | Highlight my entire signature and press CTRL+SHIFT+Down to scroll down long signatures |
To make your signature (like this), go here: https://scratch.mit.edu/discuss/settings/PutYourUsernameHere/


if <<quick? :: #965B01> and <dog <lazy? ::  #965B01> :: #984723>> then
jump over x:( dog (x):: #984723) y:(dog(y):: #984723):: #112233
end
MathPuppy314
Scratcher
500+ posts

Character clips when wall-jumping corner

I'm not quite sure what you're asking for at this point in time. I guess the wall jumping still allows the player to clip through the ceiling? If this is the case, you need to find the wall jump script and make sure you only change the x position when getting the player out of the wall. You must also do ceiling collision right after you move the player out of the wall.


If only I were a kumquat…
NotGuest_102233
Scratcher
25 posts

Character clips when wall-jumping corner

MathPuppy314 wrote:

I'm not quite sure what you're asking for at this point in time. I guess the wall jumping still allows the player to clip through the ceiling? If this is the case, you need to find the wall jump script and make sure you only change the x position when getting the player out of the wall. You must also do ceiling collision right after you move the player out of the wall.
I'll try doing that

This account is @Guest_102233's Alt account.
Guest_102233
Scratcher
100+ posts

Character clips when wall-jumping corner

heres a bumpel if anyone else has any other ways to solve this

| My Profile | Highlight my entire signature and press CTRL+SHIFT+Down to scroll down long signatures |
To make your signature (like this), go here: https://scratch.mit.edu/discuss/settings/PutYourUsernameHere/


if <<quick? :: #965B01> and <dog <lazy? ::  #965B01> :: #984723>> then
jump over x:( dog (x):: #984723) y:(dog(y):: #984723):: #112233
end
Guest_102233
Scratcher
100+ posts

Character clips when wall-jumping corner

MathPuppy314 wrote:

I'm not quite sure what you're asking for at this point in time. I guess the wall jumping still allows the player to clip through the ceiling? If this is the case, you need to find the wall jump script and make sure you only change the x position when getting the player out of the wall. You must also do ceiling collision right after you move the player out of the wall.
Tried it and it works (it's quite easy to replicate the glitch)!
I'll notify you if it isn't exactly working again.

| My Profile | Highlight my entire signature and press CTRL+SHIFT+Down to scroll down long signatures |
To make your signature (like this), go here: https://scratch.mit.edu/discuss/settings/PutYourUsernameHere/


if <<quick? :: #965B01> and <dog <lazy? ::  #965B01> :: #984723>> then
jump over x:( dog (x):: #984723) y:(dog(y):: #984723):: #112233
end

Powered by DjangoBB