Browse Source

Fix Hero 1 wall placement / raycasting

master
Luna 7 years ago
parent
commit
76ff51d5fa
2 changed files with 9 additions and 9 deletions
  1. +8
    -8
      scenes/player.tscn
  2. +1
    -1
      scripts/heroes/1.gd

+ 8
- 8
scenes/player.tscn View File

@ -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 )


+ 1
- 1
scripts/heroes/1.gd View File

@ -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


Loading…
Cancel
Save