This script will rotate a MeshInstance2D node clockwise on the screen:
extends MeshInstance2D
var rotation_speed: float = 1.0
func _process(delta: float) -> void:
rotate(delta * rotation_speed)
- Create a new scene
- add a MeshInstance2d
- set it's Mesh parameter on the right to new BoxMesh
- scale it and put it in the middle of the screen
- add this script to it
- press play
If you've figured out to do the above correctly, you will see a box spinning clockwise on your screen.
Now figure out how spin it counter-clockwise
After that see if you can figure out how to move it to the left. Then see if you can move it back and forth.
Congratulations! You've started :D