Turret Laserpointer and raycast selfcollision fix
This commit is contained in:
parent
c3255b30f2
commit
85348bbd3f
@ -42,6 +42,7 @@ func searching():
|
|||||||
var collider = sightline.get_collider()
|
var collider = sightline.get_collider()
|
||||||
if collider.is_in_group("player"):
|
if collider.is_in_group("player"):
|
||||||
prey_ref = weakref(collider)
|
prey_ref = weakref(collider)
|
||||||
|
break
|
||||||
|
|
||||||
# TODO should this stand still?
|
# TODO should this stand still?
|
||||||
# TODO Use yield and coroutine instead
|
# TODO Use yield and coroutine instead
|
||||||
|
|||||||
@ -101,7 +101,7 @@ collision_mask = 123
|
|||||||
rotation = 0.0698132
|
rotation = 0.0698132
|
||||||
enabled = true
|
enabled = true
|
||||||
cast_to = Vector2( 0, 100000 )
|
cast_to = Vector2( 0, 100000 )
|
||||||
collision_mask = 123
|
collision_mask = 121
|
||||||
|
|
||||||
[node name="Sightline2" type="RayCast2D" parent="SightCone"]
|
[node name="Sightline2" type="RayCast2D" parent="SightCone"]
|
||||||
rotation = -0.0698132
|
rotation = -0.0698132
|
||||||
|
|||||||
@ -54,7 +54,7 @@ func _get_transition(_delta):
|
|||||||
parent.get_node("StateLabel").text = self.state
|
parent.get_node("StateLabel").text = self.state
|
||||||
var new_state
|
var new_state
|
||||||
if parent.is_tracking_prey() && self.state == "searching":
|
if parent.is_tracking_prey() && self.state == "searching":
|
||||||
laserpoint.visible = true
|
laserpoint.visible = false
|
||||||
new_state = "locking"
|
new_state = "locking"
|
||||||
# TODO Helper function with null check and reference check
|
# TODO Helper function with null check and reference check
|
||||||
if !parent.is_tracking_prey() && self.state == "shooting":
|
if !parent.is_tracking_prey() && self.state == "shooting":
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user