You just need to convert the rotation to a vector using cos
and sin
. You may also need to apply an additional offset, depending on where "forward" is relative the node's rotation. Here's a code snippet (untested):
extends Node2D
func _process(delta):
var forward_dir = Vector2(cos(rotation), sin(rotation))
# then you can move the node by using it as a direction vector
translation += forward_dir * delta * 100
# you can also use global_rotation instead of rotation, which is helpful
# if the Node2Ds parent also rotates.