Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | MomoVR |
Hello, I’m trying to implement a drag and drop feature using Godot 4.
This is my code:
func _process(delta):
if dragging:
$ColorRect.rect_position = get_viewport().get_mouse_position()
(The formatting is messed up here, but I can’t get it right :/)
When i run it i get this error:
Invalid set index 'rect_position' (on base: 'ColorRect') with value of type 'Vector2'.