![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | AndrewD |
It is necessary that Area2D accept the value “rotation_Degrees” and move in its direction
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | AndrewD |
It is necessary that Area2D accept the value “rotation_Degrees” and move in its direction
![]() |
Reply From: | kidscancode |
I offer two options:
func _ready():
rotation_degrees = 45
func _process(delta):
position += Vector2.(1, 0).rotated(rotation) * speed * delta
transform
to move forward on its local axis:func _ready():
rotation_degrees = 45
func _process(delta):
position += transform.x * speed * delta
There are several examples here that you can use if you need more detail: 2D movement overview — Godot Engine (latest) documentation in English