From bbb37e1eec38d5084ab81594d765bec3ceaee4f0 Mon Sep 17 00:00:00 2001 From: unfa Date: Sun, 21 Jun 2020 00:30:45 +0200 Subject: [PATCH] Small changes of Handgun model. --- Assets/Weapons/Handgun/Handgun.blend | Bin 653740 -> 653740 bytes Assets/Weapons/Handgun/Handgun.tscn | 43 ++++++++++++++++++++++++++- Player.tscn | 10 +++---- 3 files changed, 47 insertions(+), 6 deletions(-) diff --git a/Assets/Weapons/Handgun/Handgun.blend b/Assets/Weapons/Handgun/Handgun.blend index c0cb53c141436439399c9ad01ab7516f9c2a1178..402909e9b64dd0056eafd6205339756084ae4c60 100644 GIT binary patch delta 401 zcmZ4US$)lC^$8`+9wr5iPyLb1_llw zy*+}Pu|Fp6) z8TT?xzskkLzg=YqW1=~?*}GR@Q-L&8&wHRA9)})vDUf9#db;B;M(6EwJ~Ccp zYr}NAUySbC_x@n4V4VKefXRP*%P+=20j_|4h!X<(r`!KxbltAP&D6-q6a(eG;bE#| zR5Cm<)dZojI|B*Dp*4HeFYYPK;1YM$=&*Nhfmt@(%@ltYn;73O9?N`*9Bsr&>{$ljsZes{k%H2?P3v3;bhM2%&%;d<- zeHy3(6bNEjkGBVyF{z6&GHkE#VJcFIXA7~Qtp_<>B>5A_z12Ak5(62Jt+ Y%s|Wn#H>Kf2E^<@%(0y%fOEx40AtvTF#rGn diff --git a/Assets/Weapons/Handgun/Handgun.tscn b/Assets/Weapons/Handgun/Handgun.tscn index 8079da2..fb1c518 100644 --- a/Assets/Weapons/Handgun/Handgun.tscn +++ b/Assets/Weapons/Handgun/Handgun.tscn @@ -1,7 +1,48 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://Assets/Weapons/Handgun/Handgun.gltf" type="PackedScene" id=1] +[ext_resource path="res://Assets/Weapons/Weapon.gd" type="Script" id=2] + +[sub_resource type="AnimationNodeAdd2" id=1] + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "StaticAction" + +[sub_resource type="AnimationNodeAnimation" id=3] +animation = "SlideAction" + +[sub_resource type="AnimationNodeBlendTree" id=4] +nodes/Add2/node = SubResource( 1 ) +nodes/Add2/position = Vector2( 400, 160 ) +nodes/Animation/node = SubResource( 3 ) +nodes/Animation/position = Vector2( 100, 100 ) +"nodes/Animation 2/node" = SubResource( 2 ) +"nodes/Animation 2/position" = Vector2( 100, 280 ) +nodes/output/position = Vector2( 660, 200 ) +node_connections = [ "output", 0, "Add2", "Add2", 0, "Animation", "Add2", 1, "Animation 2" ] + +[sub_resource type="AnimationNodeStateMachine" id=5] +states/Shoot/node = SubResource( 4 ) +states/Shoot/position = Vector2( 450, 217 ) + +[sub_resource type="AnimationNodeStateMachinePlayback" id=6] [node name="Weapon" type="Spatial"] +script = ExtResource( 2 ) [node name="Handgun" parent="." instance=ExtResource( 1 )] + +[node name="Static" parent="Handgun" index="0"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.175396, 0.110301, 1.48199e-08 ) + +[node name="Slide" parent="Handgun/Static" index="2"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.175396, -0.110301, -1.48199e-08 ) + +[node name="AnimationTree" type="AnimationTree" parent="."] +tree_root = SubResource( 5 ) +anim_player = NodePath("../Handgun/AnimationPlayer") +active = true +parameters/playback = SubResource( 6 ) +parameters/Shoot/Add2/add_amount = 1.0 + +[editable path="Handgun"] diff --git a/Player.tscn b/Player.tscn index 38b39d4..5958c6e 100644 --- a/Player.tscn +++ b/Player.tscn @@ -1,13 +1,13 @@ [gd_scene load_steps=6 format=2] [ext_resource path="res://Player.gd" type="Script" id=1] -[ext_resource path="res://Assets/Weapons/Handgun/Handgun.gltf" type="PackedScene" id=2] +[ext_resource path="res://Assets/Weapons/Handgun/Handgun.tscn" type="PackedScene" id=2] [sub_resource type="CapsuleShape" id=1] radius = 0.33 height = 1.1 -[sub_resource type="CylinderShape" id=4] +[sub_resource type="CylinderShape" id=2] radius = 0.2 height = 0.3 @@ -21,10 +21,10 @@ script = ExtResource( 1 ) [node name="Camera" type="Camera" parent="."] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.53592, -0.0651628 ) -[node name="Weapon" type="Spatial" parent="Camera"] +[node name="Hand" type="Spatial" parent="Camera"] transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0.335, -0.4, -0.559 ) -[node name="Handgun" parent="Camera/Weapon" instance=ExtResource( 2 )] +[node name="Weapon" parent="Camera/Hand" instance=ExtResource( 2 )] [node name="CollisionShapeBody" type="CollisionShape" parent="."] transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, 0, 0.882822, 0 ) @@ -32,7 +32,7 @@ shape = SubResource( 1 ) [node name="CollisionShapeFeet" type="CollisionShape" parent="."] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.150321, 0 ) -shape = SubResource( 4 ) +shape = SubResource( 2 ) [node name="MeshInstance" type="MeshInstance" parent="."] transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0.882822, 0 )