#Why is he inside the block instead of on it?

39 messages · Page 1 of 1 (latest)

dreamy stag
maiden maple
#

Could I see the structure of your Mario scene, and if applicable, the settings for the attached CollisionShape2D?

dreamy stag
#

ok lemme screenshot it

maiden maple
#

When you hover your mouse over the lil danger sign next to the Mario node, what does it say?

dreamy stag
#

i think its unrelated

#

how do i fix the thing tho

maiden maple
#

I'm not sure. Judging from what I see here, it seems like you've got things set up properly. Based on your first screenshot, it seems there IS some kind of collision working, just that it's misaligned. Do you know if there are any places in your code where you're setting the position of MarioSprite or MarioCollision directly?

#

Also, when you run the game and click through your active nodes in the Remote tab on the left-side of the editor, can you see where the CollisionBody is positioned compared to your sprite?

dreamy stag
#

idk

maiden maple
#

To clarify, when you run your game, you'll get a little extra option in the Scene editor that lets you see the current node tree. You can click through this and modify things at runtime, or get a better view of how things look. In a platformer game I'm working on, when I click through to the CollisionShape for my Player, I get a view of how it's shaped and where it's positioned.

#

Do you think you could get a screenshot like this?

dreamy stag
#

ok lemme screenshot

#

no i dont get an option 🙁

maiden maple
#

What do you mean by you don't get an option?

dreamy stag
#

like when i click the node from scene tree the game window disappears

maiden maple
#

It might just be going behind your Godot editor window. You can drag it to a second monitor if needed, or just navigate to the CollisionShape2D node (MarioCollision in your case) and then click the icon for the game window in your task bar to bring it back to the front.

dreamy stag
#

what to do now

maiden maple
#

Hmm.. That all looks good. I wonder if it's an issue with the collision shapes for your tiles then. Can you enable this setting in your TileMapLayer and show me what it looks like?

#

When you run the game again, it should highlight the collision shapes like so, which'll let us see if there's some kind of discrepancy between how they appear and how they register collisions.

dreamy stag
maiden maple
#

There's our issue! Your tiles all have hitboxes that are way smaller than the actual sprite representing each.

#

When you go to your tileset settings, what are the hitboxes set as? It should be a menu that looks something like this.

#

Physics being at the bottom of each tile's settings.

dreamy stag
#

it is appearing like this

#

how to fix

maiden maple
#

Can you zoom out using the - and + buttons?

dreamy stag
#

ok

#

i tried manually resizing it but didnt work

#

what to do

maiden maple
#

You should be able to click and drag the little diamonds that make up the collision shape to fill the entirety of the sprite.

dreamy stag
#

i tried but it didnt work

maiden maple
#

What's happening when you try? Could you try from the Select menu rather than the Paint one? I don't think that'd matter but it's worth a shot, cuz it's where I edit these parameters

dreamy stag
#

IT WORKED TYSM

maiden maple
#

No problem! Glad I could help!