pretty happy with ladder movement right now
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
extends Area3D
|
||||
|
||||
@onready var collision_midpoint: Node3D = $CollisionMidpoint
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass
|
||||
@@ -11,9 +13,8 @@ func _process(delta):
|
||||
|
||||
func _on_body_entered(body):
|
||||
if body.is_in_group("player"):
|
||||
body.velocity = Vector3(0,0,0)
|
||||
body.is_climbing = true
|
||||
if body.global_position.y < global_position.y:
|
||||
if body.global_position.y < collision_midpoint.global_position.y:
|
||||
body.global_position.y += .2
|
||||
|
||||
|
||||
@@ -21,4 +22,3 @@ func _on_body_exited(body):
|
||||
if body.is_in_group("player"):
|
||||
body.is_climbing = false
|
||||
body.gravity = body.default_gravity
|
||||
body.ladder_center = null
|
||||
|
||||
Reference in New Issue
Block a user