Compare commits
No commits in common. "5f0d15f7e9331b6970100137d3df5430416a0553" and "976db89477216b69799f0285ea7f4797511811aa" have entirely different histories.
5f0d15f7e9
...
976db89477
1 changed files with 6 additions and 14 deletions
16
troup.gd
16
troup.gd
|
|
@ -16,18 +16,10 @@ func _get_target(event) -> void:
|
|||
#self.position = self.position.move_toward(target.transform.position, speed * delta)
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
#if target != null:
|
||||
print(self.global_position.distance_to(target.global_position))
|
||||
|
||||
var num = abs(abs(self.global_position) - abs(target.global_position))
|
||||
#print(num)
|
||||
var direction = (target.global_position - self.global_position).normalized() * SPEED * delta
|
||||
#if (num > Vector2(2,2)):
|
||||
if (self.global_position.distance_to(target.global_position) > 0.2):
|
||||
self.velocity = direction
|
||||
#self.global_position = self.global_position.move_toward(target.global_position, SPEED * delta)
|
||||
elif (target.is_class("SentientCurrency")):
|
||||
pass
|
||||
else:
|
||||
pass
|
||||
#target = null
|
||||
if (num > Vector2(2,2)):
|
||||
self.position = self.position.move_toward(target.position, SPEED * delta)
|
||||
|
||||
move_and_slide()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue