The NPC got some functionality which now allows it to tell the PathNavigator where it wants to go, in addition to the default behavior.
13 lines
225 B
GDScript
13 lines
225 B
GDScript
extends KinematicBody
|
|
class_name NPC
|
|
|
|
|
|
var current_target = null
|
|
|
|
|
|
func set_position(position: Vector3):
|
|
transform.origin = position
|
|
|
|
|
|
func move_towards(direction_times_speed: Vector3):
|
|
move_and_slide(direction_times_speed) |