I placed tiles on the top-down game screen, and the completed sample is: Hero (Top View).
For the walls, I created a Game Object from scratch under “Create from Zero” and arranged them to surround all four sides.
The player is set to bounce slightly when hitting a wall.
There is no issue when hitting the left, right, or bottom walls (Game Objects),
but when hitting the top wall, the wall sticks to the player after the collision,
and the player is slowly pushed even while stopped.
I’m not sure what the cause is…
Also, one more thing: I created a new group for the wall objects and assigned them, but after saving and closing, then reopening, the group no longer appears.
It is recognized in the Visual Script, but it is displayed as a number, such as 10.
I think both the player and the wall objects need their Motion Mode set to Floating. Grounded is meant for platformers and treats collisions as floor, wall, or ceiling, while Floating treats everything as a wall, which fits a top down game. On Grounded, the top wall can treat the player under it as its floor and follow it like a moving platform, which could explain why only the top wall does it. For each one, select the root node, and in the Inspector under CharacterBody2D change Motion Mode to Floating.
For the group, I was able to replicate the bug and have reported it, thank you! When a group is made with Create New Group in Maker mode, it gets saved as a scene group on that one object instead of a global group, so it’s missing from the list after the project reloads. I think that’s also why the Visual Script shows it as a number.
For now you can make it from Advanced mode instead. Open the object, select the root node, go to the Groups tab next to the Inspector, click the +, and check Global when you name it. After that it shows up in Maker mode’s Set Groups list and stays there after reloading. If you use the exact same name as your old group, I think the objects you already put in it should keep working. Here’s a video of the steps:
The issue was resolved by implementing the described content.
Thank you very much!
The explanation with video demonstrations was very easy to understand!!
Although the major problem has been resolved, I have a minor question:
If you continuously collide with a wall (= game object), the wall shifts slightly.
In the first place, repeatedly ramming into a wall is unlikely, and typically walls use tiles, so I assume this is a rare case. However, is this phenomenon considered intended behavior?
It’s a bit complicated, but if mutual collisions occur, the objects will inevitably move apart—that is the intended behavior.
To address this, you can use the collision layer/mask feature to configure the objects so they do not collide with each other, or so that one object only collides with the other. This will prevent the unwanted movement.
If you enable the “mutual collision check” feature on the wall side and assign the scaffold template to the wall, the objects should stop moving as intended.