Upload files to 'scenes/assets/ladder'

This commit is contained in:
latenightz 2021-04-26 19:55:30 +00:00
parent eb5b8ef4a0
commit d2173b4436
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,29 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://scenes/assets/ladder/ladder.gd" type="Script" id=1]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.25, 1, 0.74966 )
[sub_resource type="CubeMesh" id=2]
size = Vector3( 0.5, 2, 1.5 )
[sub_resource type="SpatialMaterial" id=3]
albedo_color = Color( 0.380392, 0.4, 0.447059, 1 )
[node name="Ladder" type="Area"]
collision_layer = 0
collision_mask = 2
script = ExtResource( 1 )
[node name="CollisionShape" type="CollisionShape" parent="."]
shape = SubResource( 1 )
[node name="Mesh" type="MeshInstance" parent="."]
cast_shadow = 0
mesh = SubResource( 2 )
material/0 = SubResource( 3 )
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="body_exited" from="." to="." method="_on_body_exited"]

View File

@ -0,0 +1,17 @@
extends Area
# The Player has Physics Collision Layer set to:
# Objects (Layer 1) and Player (Layer 2).
#
# Ladder Area has Physics Collision Mask set to: Player (Layer 2),
# which means that it will detect only Players.
#
# *You can use Groups or Classes too*
func _on_body_entered(body: PhysicsBody) -> void:
body.flying = true
func _on_body_exited(body: PhysicsBody) -> void:
body.flying = false