Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | mrmtonio |
extends KinematicBody2D
func _ready():
set_physics_process(true)
func _physics_process(delta):
var x = get_viewport().get_mouse_position().x
var y = get_viewport().get_mouse_position().y
set_position(Vector2(x,y))
My code for the object looks like that, but instead of being beneath the cursor it stands off like this:
(already tried global mouse pos, and I don’t think it has to do with the object’s speed)
I’ll see what I can do when I get back from work, but if you’re not using Godot 2.1.x, you don’t need “set_physics_process(true)”
HarryCourt | 2018-07-25 23:57