From 76ff51d5faa6873565b187b3fc099675a194aa37 Mon Sep 17 00:00:00 2001 From: Luna Date: Sat, 3 Feb 2018 16:44:06 -0500 Subject: [PATCH] Fix Hero 1 wall placement / raycasting --- scenes/player.tscn | 16 ++++++++-------- scripts/heroes/1.gd | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scenes/player.tscn b/scenes/player.tscn index 3dcc6e7..16bb59a 100644 --- a/scenes/player.tscn +++ b/scenes/player.tscn @@ -110,14 +110,6 @@ skeleton = NodePath("..") material/0 = null _sections_unfolded = [ "Transform" ] -[node name="Ray" type="RayCast" parent="Yaw/Pitch" index="1"] - -enabled = true -exclude_parent = true -cast_to = Vector3( 0, 0, -100 ) -collision_mask = 1 -_sections_unfolded = [ "Transform" ] - [node name="MasterOnly" type="Node" parent="." index="4"] [node name="Crosshair" type="Label" parent="MasterOnly" index="0"] @@ -187,6 +179,14 @@ size = 1.0 near = 0.05 far = 100.0 +[node name="Ray" type="RayCast" parent="TPCamera/Camera" index="0"] + +enabled = true +exclude_parent = true +cast_to = Vector3( 0, 0, -100 ) +collision_mask = 1 +_sections_unfolded = [ "Transform" ] + [node name="MeshInstance" type="MeshInstance" parent="." index="6"] transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0.787368, 0 ) diff --git a/scripts/heroes/1.gd b/scripts/heroes/1.gd index daa8087..d192ecf 100644 --- a/scripts/heroes/1.gd +++ b/scripts/heroes/1.gd @@ -23,7 +23,7 @@ func _process(delta): if is_placing_wall: # Find the point we're looking at, and put the wall there var aim = get_node("Yaw/Pitch").get_global_transform().basis - var look_ray = get_node("Yaw/Pitch/Ray") + var look_ray = get_node("TPCamera/Camera/Ray") var pos = look_ray.get_collision_point() placing_wall_node.set_translation(pos) var towards = look_ray.get_collision_normal() + pos