Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | zeelox |
hi guys
i’m new in godot engine and i have a probem with this code :
i want the saibamen to follow the mouse. i don’t have any errors but the sprite don’t move anymore please help me <3
extends KinematicBody2D
func _ready():
set_process(true)
set_physics_process(true)
pass
func _process(delta):
pass
func _physics_process(delta):
var mouse_pos = get_global_mouse_position()
var tween = get_node("Tween")
var saibamen = get_node("Saibamen")
if(Input.is_action_pressed("ui_accept")):
tween.interpolate_property(saibamen, "Transform/Position", saibamen.position, mouse_pos, 5, tween.TRANS_BACK, tween.EASE_OUT)
tween.start()
pass
pass