- Added some basic code that reacts to a bug being clicked.
- No need to check if the BugMarker dummy is valid any more, because it's definitely valid.
This commit is contained in:
parent
8062cd3641
commit
49a9f775b8
@ -32,8 +32,9 @@ mesh = SubResource("QuadMesh_dd1nc")
|
||||
|
||||
[node name="Info" type="Area3D" parent="Billboard" groups=["BugMarkerInfo"]]
|
||||
collision_layer = 4294967295
|
||||
collision_mask = 4294967295
|
||||
collision_mask = 0
|
||||
monitoring = false
|
||||
monitorable = false
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Billboard/Info"]
|
||||
shape = SubResource("SphereShape3D_t2p88")
|
||||
|
||||
@ -292,6 +292,12 @@ func __raycast_to_world():
|
||||
__laser_beam.visible = false
|
||||
|
||||
func __place_marker(_position:Vector3, _normal:Vector3):
|
||||
if __raycast_collision:
|
||||
var collider : Area3D = __raycast_collision["collider"] as Area3D
|
||||
if collider and collider.is_in_group("BugMarkerInfo"):
|
||||
print("Hit a guy!")
|
||||
return
|
||||
|
||||
var marker : BugMarker = (load(bug_marker) as PackedScene).instantiate() as BugMarker
|
||||
get_tree().get_root().add_child(marker)
|
||||
marker.global_position = _position
|
||||
@ -300,7 +306,6 @@ func __place_marker(_position:Vector3, _normal:Vector3):
|
||||
|
||||
|
||||
func __place_dummy_marker():
|
||||
if __bug_marker_dummy:
|
||||
if __raycast_collision:
|
||||
__bug_marker_dummy.set_rotation_to_normal(__raycast_collision["normal"])
|
||||
__bug_marker_dummy.visible = true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user