first
This commit is contained in:
14
actors/Enemies/Spider/step_targets_container.gd
Normal file
14
actors/Enemies/Spider/step_targets_container.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
extends Node3D
|
||||
|
||||
@export var offset: float = 10
|
||||
|
||||
@onready var parent = get_parent_node_3d()
|
||||
@onready var previous_position = parent.global_position
|
||||
func _ready() -> void:
|
||||
offset = offset*owner.scale.x
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
var velovity : Vector3 = (owner.global_position - previous_position) * delta
|
||||
global_position = owner.global_position + velovity.normalized() * offset
|
||||
|
||||
previous_position = owner.global_position
|
||||
Reference in New Issue
Block a user