Turret Laserpointer and raycast selfcollision fix

This commit is contained in:
Jakob Feldmann 2022-06-25 15:43:49 +02:00
parent c3255b30f2
commit 85348bbd3f
3 changed files with 3 additions and 2 deletions

View File

@ -42,6 +42,7 @@ func searching():
var collider = sightline.get_collider()
if collider.is_in_group("player"):
prey_ref = weakref(collider)
break
# TODO should this stand still?
# TODO Use yield and coroutine instead

View File

@ -101,7 +101,7 @@ collision_mask = 123
rotation = 0.0698132
enabled = true
cast_to = Vector2( 0, 100000 )
collision_mask = 123
collision_mask = 121
[node name="Sightline2" type="RayCast2D" parent="SightCone"]
rotation = -0.0698132

View File

@ -54,7 +54,7 @@ func _get_transition(_delta):
parent.get_node("StateLabel").text = self.state
var new_state
if parent.is_tracking_prey() && self.state == "searching":
laserpoint.visible = true
laserpoint.visible = false
new_state = "locking"
# TODO Helper function with null check and reference check
if !parent.is_tracking_prey() && self.state == "shooting":