how to set the position of a characterbody2d (godot 4.0)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By smeks

this is probably a dumb question but i havent seen it anywhere. ive tried position, set_position, set_global_position, set_pos. nothing works

godot 4.0 btw

You can use the global_position property of Node2D, which is a Vector2 ie:

func _ready():
    global_position=Vector2(0,0)

theTopHatCat | 2023-03-12 14:57

:bust_in_silhouette: Reply From: jisuwudou

set inherit var “velocity” and call move_and_slide()