Better bullet traces and raycast for hitscan
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://b0agqeg53tey5"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://b0agqeg53tey5"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/weapon/bullet.gd" id="1_th28m"]
|
||||
|
||||
@ -8,6 +8,10 @@ size = Vector3(0.2, 0.2, 0.5)
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_p8o05"]
|
||||
albedo_color = Color(0.894987, 0.000702324, 0.905119, 1)
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_l3sdq"]
|
||||
height = 0.3
|
||||
radius = 0.08
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ynv38"]
|
||||
albedo_color = Color(0.929412, 0, 0, 1)
|
||||
emission_enabled = true
|
||||
@ -27,33 +31,42 @@ linear_accel_max = 6.67
|
||||
size = Vector3(0.05, 0.05, 0.05)
|
||||
|
||||
[node name="Bullet" type="Node3D"]
|
||||
visible = false
|
||||
script = ExtResource("1_th28m")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
[node name="RigidBody3D" type="RigidBody3D" parent="."]
|
||||
mass = 0.01
|
||||
continuous_cd = true
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="RigidBody3D"]
|
||||
transform = Transform3D(0.663102, 0, 0, 0, 0.601826, 0, 0, 0, 0.58984, 0, 0, 0)
|
||||
mesh = SubResource("BoxMesh_vxst2")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_p8o05")
|
||||
|
||||
[node name="RayCast3D" type="RayCast3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.100459)
|
||||
target_position = Vector3(0, 0, -0.5)
|
||||
[node name="RayCast3D" type="RayCast3D" parent="RigidBody3D" groups=["body"]]
|
||||
exclude_parent = false
|
||||
target_position = Vector3(0, 0, 2)
|
||||
hit_back_faces = false
|
||||
collide_with_areas = true
|
||||
|
||||
[node name="Timer" type="Timer" parent="RigidBody3D"]
|
||||
wait_time = 10.0
|
||||
one_shot = true
|
||||
autostart = true
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="RigidBody3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
|
||||
shape = SubResource("CylinderShape3D_l3sdq")
|
||||
|
||||
[node name="GPUParticles3D" type="GPUParticles3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.18476)
|
||||
material_override = SubResource("StandardMaterial3D_ynv38")
|
||||
emitting = false
|
||||
amount = 10
|
||||
lifetime = 6.29
|
||||
one_shot = true
|
||||
explosiveness = 1.0
|
||||
process_material = SubResource("ParticleProcessMaterial_58cgi")
|
||||
draw_pass_1 = SubResource("BoxMesh_mfkmi")
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 10.0
|
||||
one_shot = true
|
||||
autostart = true
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
|
||||
[connection signal="timeout" from="RigidBody3D/Timer" to="." method="_on_timer_timeout"]
|
||||
|
Reference in New Issue
Block a user