Godot Version
Godot version 4.2.2
Question
I’m trying to make that old puzzle game where you control a 2x1x1 rectangular block and roll it around on a tile grid. The goal is to drop the player block into a square hole at the end of each level. The problem I’m facing is the movement of the player block. I don’t have a great background in physics but I know I need a combination of angular and linear momentum.
Here is a short video of what I’m trying to do:
The above example was animated in Blender but in Godot I need the block to roll 90 degrees and only when the player enters the correct keyboard input. I’ve been trying to figure out how to implement this for a while and I’m pretty frustrated. Any help would be very much appreciated.
You can do this entirely with animation, you don’t need physics. You can also potentially hand-animate it; movement is just a rotation of pi/2 radians (or 90 degrees) along with movement in the direction of the roll. If you just interpolate both the movement and the rotation over the same amount of time, it won’t be perfect but it will be pretty close.
1 Like
Thank you. I’ll give this a try.
Hello again. I have been playing around with this for a bit and am closer to my goal but still not quite there.
This is the setup I have right now:
and this is what I get from running it and pressing the left arrow four times:
Am I on the right track here or is there an obviouse simpler solution that im just missing.
thanks.
Your movie doesn’t play for me, but it looks like you’re heading in a direction that will work. You might want to look at tweening; that would let you set up a target position and rotation and then have them be applied over time.