#Why is he inside the block instead of on it?
39 messages · Page 1 of 1 (latest)
Could I see the structure of your Mario scene, and if applicable, the settings for the attached CollisionShape2D?
When you hover your mouse over the lil danger sign next to the Mario node, what does it say?
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?
idk
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?
What do you mean by you don't get an option?
like when i click the node from scene tree the game window disappears
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.
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.
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.
Can you zoom out using the - and + buttons?
You should be able to click and drag the little diamonds that make up the collision shape to fill the entirety of the sprite.
i tried but it didnt work
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
IT WORKED TYSM
No problem! Glad I could help!