Improve meldewesen visibility

This commit is contained in:
karl 2020-01-28 18:51:19 +01:00
parent afc257ded6
commit 1620cc68d5
2 changed files with 38 additions and 18 deletions

View File

@ -150,8 +150,41 @@ material/0 = null
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1.71555, 0 ) transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1.71555, 0 )
shape = SubResource( 5 ) shape = SubResource( 5 )
[node name="InteractCheckRays" type="Spatial" parent="."]
transform = Transform( 1, 0, 0, 0, 0.940387, 0.340106, 0, -0.340106, 0.940387, 0, 2.493, 0.464 )
[node name="InteractCheckCast1" type="RayCast" parent="InteractCheckRays"]
transform = Transform( 0.969178, 0.0347382, 0.243902, 0.0829525, 0.886188, -0.45584, -0.231978, 0.462022, 0.855992, 0, 1.76314, 0.144732 )
enabled = true
cast_to = Vector3( 0, -10, -40 )
collision_mask = 3
[node name="InteractCheckCast2" type="RayCast" parent="InteractCheckRays"]
transform = Transform( 0.969178, -0.0347382, -0.243902, -0.0829525, 0.886188, -0.45584, 0.231978, 0.462022, 0.855992, 0, 1.76314, 0.144732 )
enabled = true
cast_to = Vector3( 0, -10, -40 )
collision_mask = 3
[node name="InteractCheckCast3" type="RayCast" parent="InteractCheckRays"]
transform = Transform( 1, 0, 0, 0, 0.8784, -0.477925, 0, 0.477925, 0.8784, 0, 1.76314, 0.144732 )
enabled = true
cast_to = Vector3( 0, -10, -40 )
collision_mask = 3
[node name="InteractCheckCast4" type="RayCast" parent="InteractCheckRays"]
transform = Transform( 0.994522, 0.0499568, 0.0918178, 0, 0.8784, -0.477925, -0.104528, 0.475307, 0.873588, 0, 1.76314, 0.144732 )
enabled = true
cast_to = Vector3( 0, -10, -40 )
collision_mask = 3
[node name="InteractCheckCast5" type="RayCast" parent="InteractCheckRays"]
transform = Transform( 0.994522, -0.0499568, -0.0918178, 0, 0.8784, -0.477925, 0.104528, 0.475307, 0.873588, 0, 1.76314, 0.144732 )
enabled = true
cast_to = Vector3( 0, -10, -40 )
collision_mask = 3
[node name="Visibility" type="Area" parent="."] [node name="Visibility" type="Area" parent="."]
transform = Transform( 1, 0, 0, 0, 0.940387, 0.340106, 0, -0.340106, 0.940387, 0, 2.29274, 0.463551 ) transform = Transform( 1, 0, 0, 0, 0.940387, 0.340106, 0, -0.340106, 0.940387, 0, 2.493, 0.464 )
collision_layer = 4 collision_layer = 4
collision_mask = 4 collision_mask = 4
script = ExtResource( 6 ) script = ExtResource( 6 )
@ -173,20 +206,6 @@ shadow_enabled = true
spot_range = 11.6162 spot_range = 11.6162
spot_angle = 19.7549 spot_angle = 19.7549
[node name="InteractCheckRays" type="Spatial" parent="Visibility"]
[node name="InteractCheckCast1" type="RayCast" parent="Visibility/InteractCheckRays"]
transform = Transform( 0.965926, 0, 0.258819, 0.0880259, 0.940387, -0.328517, -0.24339, 0.340106, 0.908345, 0, 1.76314, 0.144732 )
enabled = true
cast_to = Vector3( 0, -10, -40 )
collision_mask = 3
[node name="InteractCheckCast2" type="RayCast" parent="Visibility/InteractCheckRays"]
transform = Transform( 0.965926, 0, -0.258819, -0.0880259, 0.940387, -0.328517, 0.24339, 0.340106, 0.908345, 0, 1.76314, 0.144732 )
enabled = true
cast_to = Vector3( 0, -10, -40 )
collision_mask = 3
[node name="InteractArea" type="Area" parent="." groups=[ [node name="InteractArea" type="Area" parent="." groups=[
"Enemy", "Enemy",
]] ]]

View File

@ -1,9 +1,9 @@
extends Area extends Area
onready var rays = get_node("InteractCheckRays") onready var rays = get_node("../InteractCheckRays")
var max_distance = 20 var max_distance = 40
func _process(delta: float) -> void: func _process(delta: float) -> void:
@ -21,4 +21,5 @@ func _process(delta: float) -> void:
if potential_new_scale < new_scale: if potential_new_scale < new_scale:
new_scale = potential_new_scale new_scale = potential_new_scale
scale = Vector3(new_scale, 1.0, new_scale) scale = Vector3(new_scale, new_scale, new_scale)
translation.y = 2.3 + (1.0 - new_scale) * 2.0 # Need to compensate for offset caused by y translation