mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-13 20:47:19 +01:00
Add range check to the new teleporter.
This commit is contained in:
parent
f96a66300b
commit
b147b81e01
@ -2,6 +2,7 @@ extends StaticBody
|
||||
|
||||
export(Color) var default_albedo : Color = Color(0.494118, 0.494118, 0.494118)
|
||||
export(Color) var hover_albedo : Color = Color(0.65098, 0.65098, 0.65098)
|
||||
export(float) var use_range : float = 3
|
||||
|
||||
var teleport_to : Vector3 = Vector3()
|
||||
|
||||
@ -37,4 +38,7 @@ func teleport():
|
||||
if world && world._player:
|
||||
var p : Entity = world._player
|
||||
|
||||
if (p.get_body().transform.origin - transform.origin).length() > use_range:
|
||||
return
|
||||
|
||||
p.get_body().transform.origin = teleport_to
|
||||
|
@ -17,7 +17,6 @@ extents = Vector3( 0.5, 0.5, 0.5 )
|
||||
[node name="DungeonTeleporter" type="StaticBody"]
|
||||
script = ExtResource( 1 )
|
||||
default_albedo = Color( 0.521569, 0.521569, 0.521569, 1 )
|
||||
hover_albedo = Color( 0.65098, 0.65098, 0.65098, 1 )
|
||||
|
||||
[node name="MeshInstance" type="MeshInstance" parent="."]
|
||||
mesh = SubResource( 1 )
|
||||
|
Loading…
Reference in New Issue
Block a user