mittagessen war gut

This commit is contained in:
Ententerminator 2020-02-01 15:17:25 +01:00
parent de8777480b
commit 6127c14f82
5 changed files with 53 additions and 44 deletions

View File

@ -47,7 +47,7 @@ handle_input_locally = false
render_target_update_mode = 3 render_target_update_mode = 3
[node name="Camera" type="Camera" parent="GUI/HBoxC/ViewportContainer/Viewport"] [node name="Camera" type="Camera" parent="GUI/HBoxC/ViewportContainer/Viewport"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 4.16872 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 7.8064 )
[node name="MouseLook" type="RayCast" parent="GUI/HBoxC/ViewportContainer/Viewport"] [node name="MouseLook" type="RayCast" parent="GUI/HBoxC/ViewportContainer/Viewport"]
enabled = true enabled = true

View File

@ -67,8 +67,11 @@ func _physics_process(delta):
if _rayCast.is_colliding(): if _rayCast.is_colliding():
# collider will be the node hit # collider will be the node hit
_attachment_point = _rayCast.get_collider().get_parent() make_it_shine(false)
print(_rayCast.get_collider()) var temp = _rayCast.get_collider().get_parent()
if temp.has_node("OmniLight"):
_attachment_point = temp
make_it_shine(true)
func _input(event): func _input(event):
@ -85,3 +88,8 @@ func _input(event):
func body_part_chosen(params): func body_part_chosen(params):
_attachment_point.add_child(BodyPartLoader.bodyparts[params].instance()) _attachment_point.add_child(BodyPartLoader.bodyparts[params].instance())
func make_it_shine(highlight : bool):
if _attachment_point != null:
_attachment_point.get_node("OmniLight").visible = highlight

View File

@ -4,7 +4,7 @@
[ext_resource path="res://3D Input/untitled.glb" type="PackedScene" id=2] [ext_resource path="res://3D Input/untitled.glb" type="PackedScene" id=2]
[ext_resource path="res://BodyParts/Arm.gd" type="Script" id=3] [ext_resource path="res://BodyParts/Arm.gd" type="Script" id=3]
[sub_resource type="CapsuleShape" id=3] [sub_resource type="CapsuleShape" id=1]
radius = 0.724339 radius = 0.724339
height = 5.27855 height = 5.27855
@ -13,28 +13,33 @@ radius = 0.591769
[node name="Arm" instance=ExtResource( 1 )] [node name="Arm" instance=ExtResource( 1 )]
script = ExtResource( 3 ) script = ExtResource( 3 )
key = 0
damage = 10.0
[node name="PartCollider" parent="." index="0"] [node name="PartCollider" parent="." index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -5.34203 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.83 )
shape = SubResource( 3 ) shape = SubResource( 1 )
[node name="Mesh" parent="." index="1" instance=ExtResource( 2 )] [node name="Mesh" parent="." index="1" instance=ExtResource( 2 )]
[node name="Sphere" parent="Mesh" index="0"] [node name="Sphere" parent="Mesh" index="0"]
visible = false visible = false
[node name="Armature" parent="Mesh" index="1"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"] [node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"]
transform = Transform( 1, -1.98247e-23, -2.98292e-24, 6.50669e-24, -9.49949e-08, 1, -2.07684e-23, -1, -9.49949e-08, -2.23781e-16, -0.0078205, -5.05441 ) transform = Transform( 1, -1.98292e-23, -3.18966e-24, 6.71348e-24, -9.49949e-08, 1, -2.07636e-23, -1, -9.49949e-08, -2.23781e-16, -0.0078205, -5.05441 )
bone_name = "bone_2" bone_name = "bone_2"
[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"] [node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"]
remote_path = NodePath("../../../../../TouchArea") remote_path = NodePath("../../../../../TouchArea")
[node name="TouchArea" parent="." index="2"] [node name="TouchArea" parent="." index="2"]
transform = Transform( 1, -1.98247e-23, -2.98292e-24, 6.50669e-24, -9.49949e-08, 1, -2.07684e-23, -1, -9.49949e-08, -2.23781e-16, -0.0078205, -7.60024 ) transform = Transform( 1, -1.98292e-23, -3.18966e-24, 6.71348e-24, -9.49949e-08, 1, -2.07636e-23, -1, -9.49949e-08, -2.23781e-16, -0.0078205, -5.05441 )
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"] [node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
transform = Transform( 1, 2.98291e-24, -1.98247e-23, -2.07684e-23, -9.49949e-08, -1, -6.50669e-24, 1, -9.49949e-08, 2.23781e-16, 0.399765, 0.00782054 ) transform = Transform( 1, 2.98291e-24, -1.98247e-23, -2.07684e-23, -9.49949e-08, -1, -6.50669e-24, 1, -9.49949e-08, 0, 0, 0 )
shape = SubResource( 2 ) shape = SubResource( 2 )
[editable path="Mesh"] [editable path="Mesh"]

View File

@ -0,0 +1,26 @@
[gd_scene load_steps=3 format=2]
[sub_resource type="SphereMesh" id=1]
[sub_resource type="SphereShape" id=2]
[node name="AttachmentPoint" type="Spatial"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
[node name="Mesh" type="MeshInstance" parent="."]
transform = Transform( 0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, 0, 0, 0 )
mesh = SubResource( 1 )
material/0 = null
[node name="OmniLight" type="OmniLight" parent="."]
transform = Transform( 1, 3.12639e-13, -1.77715e-26, -3.12639e-13, 1, -5.68434e-14, 0, 5.68434e-14, 1, -0.680858, 0, -1.38872 )
visible = false
light_color = Color( 0.956863, 0.121569, 0.121569, 1 )
light_energy = 3.86
omni_range = 1.8
[node name="Area" type="Area" parent="."]
[node name="CollisionShape" type="CollisionShape" parent="Area"]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0 )
shape = SubResource( 2 )

View File

@ -1,19 +1,12 @@
[gd_scene load_steps=8 format=2] [gd_scene load_steps=5 format=2]
[ext_resource path="res://BodyParts/BodyBase/BodyBase.gd" type="Script" id=1] [ext_resource path="res://BodyParts/BodyBase/BodyBase.gd" type="Script" id=1]
[ext_resource path="res://BodyParts/BodyBase/AttachmentPoint.tscn" type="PackedScene" id=2]
[sub_resource type="CapsuleMesh" id=1] [sub_resource type="CapsuleMesh" id=1]
[sub_resource type="CapsuleShape" id=2] [sub_resource type="CapsuleShape" id=2]
[sub_resource type="SphereMesh" id=3]
[sub_resource type="GDScript" id=4]
[sub_resource type="SphereShape" id=5]
[sub_resource type="SphereShape" id=6]
[node name="Torso" type="RigidBody"] [node name="Torso" type="RigidBody"]
script = ExtResource( 1 ) script = ExtResource( 1 )
@ -25,31 +18,8 @@ material/0 = null
transform = Transform( 0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0 ) transform = Transform( 0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0 )
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="FrontLeft" type="Spatial" parent="."] [node name="FrontLeft" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.5, -1.62921e-07, -0.866025, -3.25841e-07, -1, 0, -0.866025, 2.82187e-07, -0.5, 0.6, 0, 1 ) transform = Transform( 0.5, -1.62921e-07, -0.866025, -3.25841e-07, -1, 0, -0.866025, 2.82187e-07, -0.5, 0.6, 0, 1 )
[node name="FrontLeftAttachMent" type="MeshInstance" parent="FrontLeft"] [node name="FrontRight" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, 0, 0, 0 ) transform = Transform( -0.5, 0, 0.866025, 0, 1, 0, -0.866025, 0, -0.5, -0.6, 0, 1 )
mesh = SubResource( 3 )
material/0 = null
[node name="Area" type="Area" parent="FrontLeft"]
script = SubResource( 4 )
[node name="CollisionShape" type="CollisionShape" parent="FrontLeft/Area"]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0 )
shape = SubResource( 5 )
[node name="FrontRight" type="Spatial" parent="."]
transform = Transform( 0.5, -1.62921e-07, 0.866025, -3.25841e-07, -1, 0, 0.866025, -2.82187e-07, -0.5, -0.6, 0, 1 )
[node name="FrontRightAttachMent" type="MeshInstance" parent="FrontRight"]
transform = Transform( 0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, 0, 0, 0 )
mesh = SubResource( 3 )
material/0 = null
[node name="Area" type="Area" parent="FrontRight"]
[node name="CollisionShape" type="CollisionShape" parent="FrontRight/Area"]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0 )
shape = SubResource( 6 )