From 2a0eaa8610e442ea48b9606950122c09520a0f6c Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 23 Jul 2020 20:15:56 +0200 Subject: [PATCH] Only set placed to true if the raycast actually found something. --- game/player/Body.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/player/Body.gd b/game/player/Body.gd index f02d4881..72d3f53f 100644 --- a/game/player/Body.gd +++ b/game/player/Body.gd @@ -182,7 +182,7 @@ func _physics_process(delta : float) -> void: if world != null: if not world.is_position_walkable(transform.origin): return - + var space : PhysicsDirectSpaceState = get_world().direct_space_state var res : Dictionary = space.intersect_ray(transform.origin, transform.origin + Vector3(0, -100, 0), [ self ]) @@ -190,8 +190,8 @@ func _physics_process(delta : float) -> void: if not res.empty(): var pos : Vector3 = res["position"] transform.origin = pos + Vector3(0, 0.2, 0) + placed = true - placed = true return if entity.c_is_controlled: