Topic was automatically imported from the old Question2Answer platform.
Asked By
Mohan
Old Version
Published before Godot 3 was released.
Here I am. Once again. Asking a kind of different question.
I have no idea how to make this freaking box move. In my scene. I am trying to make this sokoban game work, but if I can’t make this box move, then I am not going to make it.
I tried making the box node a RigidBody2D and setting the default gravity to (0,0) in the physics properties. That should avoid making it fall to the ground. But I can’t make the player push it. It will just block the way of the player like a regular static body.
To push the block your player would have to be a RigidBody too (I’m guessing you’re using KinematicBody?). And then depending on the relative masses and applied force, the block would move.
But that’s typically not how Sokoban-style games work. They’re definitely not using physics - it’s way too complex. You just use a grid, and if the player moves into a block, you try and move the block by one square.