Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ismaelgame7 | |
Old Version | Published before Godot 3 was released. |
Hello,
I’m trying to make a zombie follow the player only on the X axis, Look:
extends KinematicBody2
var zumbie = self
var speed = 2
onready var target = get_parent().get_node("Player")
func _ready():
set_fixed_process(true)
pass
func _fixed_process(delta):
var direction = (target.get_global_pos().x - zumbie.get_global_pos().x).normalized()
move(direction*speed)
pass
But gives this error: Invalid call. Nonexistent function ‘normalized’ in base ‘float’.
Can someone help me?