ladder working

This commit is contained in:
Derek
2024-07-28 12:04:13 -05:00
parent 1b883866da
commit 5a41a22160
5 changed files with 69 additions and 48 deletions

View File

@@ -1,24 +1,25 @@
extends Node3D
extends Area3D
var is_climbing = false
var ladder_center
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
ladder_center = self.global_position
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_area_3d_body_entered(body):
func _on_body_entered(body):
if body.is_in_group("player"):
is_climbing = true
body.lader_collide(is_climbing)
body.is_climbing = true
body.ladder_center = ladder_center
func _on_area_3d_body_exited(body):
func _on_body_exited(body):
if body.is_in_group("player"):
is_climbing = false
body.lader_collide(is_climbing)
body.is_climbing = false
body.gravity = body.default_gravity
body.ladder_center = null