ladder and rats looking pretty good. still need to fix rat holes
This commit is contained in:
14
assets/blood.gdshader
Normal file
14
assets/blood.gdshader
Normal file
@@ -0,0 +1,14 @@
|
||||
shader_type spatial;
|
||||
|
||||
void vertex() {
|
||||
// Called for every vertex the material is visible on.
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
// Called for every pixel the material is visible on.
|
||||
}
|
||||
|
||||
//void light() {
|
||||
// Called for every pixel for every light affecting the material.
|
||||
// Uncomment to replace the default light processing function with this one.
|
||||
//}
|
||||
239
assets/blood.tres
Normal file
239
assets/blood.tres
Normal file
@@ -0,0 +1,239 @@
|
||||
[gd_resource type="VisualShader" load_steps=22 format=3 uid="uid://ddeew8xbtykrq"]
|
||||
|
||||
[sub_resource type="VisualShaderNodeColorConstant" id="VisualShaderNodeColorConstant_ncvl6"]
|
||||
constant = Color(0.665604, 1.96133e-06, 4.33177e-07, 1)
|
||||
|
||||
[sub_resource type="VisualShaderNodeFloatConstant" id="VisualShaderNodeFloatConstant_ce6tx"]
|
||||
constant = 0.5
|
||||
|
||||
[sub_resource type="VisualShaderNodeFloatFunc" id="VisualShaderNodeFloatFunc_2du5f"]
|
||||
output_port_for_preview = 0
|
||||
function = 31
|
||||
|
||||
[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_3of4b"]
|
||||
input_name = "color"
|
||||
|
||||
[sub_resource type="VisualShaderNodeVectorDecompose" id="VisualShaderNodeVectorDecompose_50gpj"]
|
||||
|
||||
[sub_resource type="VisualShaderNodeFloatOp" id="VisualShaderNodeFloatOp_u51ta"]
|
||||
default_input_values = [0, 0.0, 1, 0.1]
|
||||
operator = 2
|
||||
|
||||
[sub_resource type="VisualShaderNodeUVFunc" id="VisualShaderNodeUVFunc_d33ia"]
|
||||
|
||||
[sub_resource type="VisualShaderNodeFloatConstant" id="VisualShaderNodeFloatConstant_jsho4"]
|
||||
constant = 1.0
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_anxeu"]
|
||||
noise_type = 3
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_q7o3u"]
|
||||
noise = SubResource("FastNoiseLite_anxeu")
|
||||
|
||||
[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_fa4vl"]
|
||||
texture = SubResource("NoiseTexture2D_q7o3u")
|
||||
|
||||
[sub_resource type="VisualShaderNodeFloatOp" id="VisualShaderNodeFloatOp_pkecw"]
|
||||
output_port_for_preview = 0
|
||||
default_input_values = [0, 0.0, 1, 5.0]
|
||||
operator = 5
|
||||
|
||||
[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_66yqg"]
|
||||
input_name = "uv"
|
||||
|
||||
[sub_resource type="VisualShaderNodeUVPolarCoord" id="VisualShaderNodeUVPolarCoord_662y1"]
|
||||
output_port_for_preview = 0
|
||||
default_input_values = [1, Vector2(0.5, 0.5), 2, 1.0, 3, 0.0]
|
||||
|
||||
[sub_resource type="VisualShaderNodeColorFunc" id="VisualShaderNodeColorFunc_tlel1"]
|
||||
output_port_for_preview = 0
|
||||
|
||||
[sub_resource type="VisualShaderNodeFloatFunc" id="VisualShaderNodeFloatFunc_cmbe8"]
|
||||
output_port_for_preview = 0
|
||||
function = 31
|
||||
|
||||
[sub_resource type="VisualShaderNodeVectorOp" id="VisualShaderNodeVectorOp_a83e8"]
|
||||
operator = 2
|
||||
|
||||
[sub_resource type="VisualShaderNodeVectorOp" id="VisualShaderNodeVectorOp_w0l32"]
|
||||
operator = 2
|
||||
|
||||
[sub_resource type="VisualShaderNodeBillboard" id="VisualShaderNodeBillboard_drqma"]
|
||||
keep_scale = true
|
||||
|
||||
[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_0eixc"]
|
||||
input_name = "instance_id"
|
||||
|
||||
[sub_resource type="VisualShaderNodeVectorCompose" id="VisualShaderNodeVectorCompose_mv5vw"]
|
||||
|
||||
[resource]
|
||||
code = "shader_type spatial;
|
||||
render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_lambert, specular_schlick_ggx;
|
||||
|
||||
uniform sampler2D tex_frg_2;
|
||||
|
||||
|
||||
|
||||
void vertex() {
|
||||
// Input:3
|
||||
int n_out3p0 = INSTANCE_ID;
|
||||
|
||||
|
||||
// VectorCompose:4
|
||||
float n_in4p1 = 0.00000;
|
||||
float n_in4p2 = 0.00000;
|
||||
vec3 n_out4p0 = vec3(float(n_out3p0), n_in4p1, n_in4p2);
|
||||
|
||||
|
||||
mat4 n_out2p0;
|
||||
// GetBillboardMatrix:2
|
||||
{
|
||||
mat4 __mvm = VIEW_MATRIX * mat4(INV_VIEW_MATRIX[0], INV_VIEW_MATRIX[1], INV_VIEW_MATRIX[2], MODEL_MATRIX[3]);
|
||||
__mvm = __mvm * mat4(vec4(length(MODEL_MATRIX[0].xyz), 0.0, 0.0, 0.0), vec4(0.0, length(MODEL_MATRIX[1].xyz), 0.0, 0.0), vec4(0.0, 0.0, length(MODEL_MATRIX[2].xyz), 0.0), vec4(0.0, 0.0, 0.0, 1.0));
|
||||
n_out2p0 = __mvm;
|
||||
}
|
||||
|
||||
|
||||
// Output:0
|
||||
COLOR.rgb = n_out4p0;
|
||||
MODELVIEW_MATRIX = n_out2p0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
// ColorConstant:10
|
||||
vec4 n_out10p0 = vec4(0.665604, 0.000002, 0.000000, 1.000000);
|
||||
|
||||
|
||||
// Input:4
|
||||
vec2 n_out4p0 = UV;
|
||||
|
||||
|
||||
vec2 n_out5p0;
|
||||
// UVPolarCoord:5
|
||||
vec2 n_in5p1 = vec2(0.50000, 0.50000);
|
||||
float n_in5p2 = 1.00000;
|
||||
float n_in5p3 = 0.00000;
|
||||
{
|
||||
vec2 __dir = n_out4p0 - n_in5p1;
|
||||
float __radius = length(__dir) * 2.0;
|
||||
float __angle = atan(__dir.y, __dir.x) * 1.0 / (PI * 2.0);
|
||||
n_out5p0 = vec2(__radius * n_in5p2, __angle * n_in5p3);
|
||||
}
|
||||
|
||||
|
||||
vec3 n_out6p0;
|
||||
// ColorFunc:6
|
||||
{
|
||||
vec3 c = vec3(n_out5p0, 0.0);
|
||||
float max1 = max(c.r, c.g);
|
||||
float max2 = max(max1, c.b);
|
||||
n_out6p0 = vec3(max2, max2, max2);
|
||||
}
|
||||
|
||||
|
||||
// FloatFunc:7
|
||||
float n_out7p0 = 1.0 - n_out6p0.x;
|
||||
|
||||
|
||||
// Input:13
|
||||
vec4 n_out13p0 = COLOR;
|
||||
|
||||
|
||||
// VectorDecompose:14
|
||||
float n_out14p0 = vec3(n_out13p0.xyz).x;
|
||||
float n_out14p1 = vec3(n_out13p0.xyz).y;
|
||||
float n_out14p2 = vec3(n_out13p0.xyz).z;
|
||||
|
||||
|
||||
// FloatOp:15
|
||||
float n_in15p1 = 0.10000;
|
||||
float n_out15p0 = n_out14p0 * n_in15p1;
|
||||
|
||||
|
||||
// UVFunc:16
|
||||
vec2 n_in16p1 = vec2(1.00000, 1.00000);
|
||||
vec2 n_out16p0 = vec2(n_out15p0) * n_in16p1 + n_out4p0;
|
||||
|
||||
|
||||
// Texture2D:2
|
||||
vec4 n_out2p0 = texture(tex_frg_2, n_out16p0);
|
||||
|
||||
|
||||
// FloatOp:3
|
||||
float n_in3p1 = 5.00000;
|
||||
float n_out3p0 = pow(n_out2p0.x, n_in3p1);
|
||||
|
||||
|
||||
// VectorOp:8
|
||||
vec3 n_out8p0 = vec3(n_out7p0) * vec3(n_out3p0);
|
||||
|
||||
|
||||
// VectorOp:9
|
||||
vec3 n_out9p0 = vec3(n_out10p0.xyz) * n_out8p0;
|
||||
|
||||
|
||||
// FloatConstant:11
|
||||
float n_out11p0 = 0.500000;
|
||||
|
||||
|
||||
// FloatConstant:17
|
||||
float n_out17p0 = 1.000000;
|
||||
|
||||
|
||||
// FloatFunc:12
|
||||
float n_out12p0 = 1.0 - n_out3p0;
|
||||
|
||||
|
||||
// Output:0
|
||||
ALBEDO = n_out9p0;
|
||||
ALPHA = n_out11p0;
|
||||
SSS_STRENGTH = n_out17p0;
|
||||
ALPHA_SCISSOR_THRESHOLD = n_out12p0;
|
||||
|
||||
|
||||
}
|
||||
"
|
||||
graph_offset = Vector2(-911.268, 90.5684)
|
||||
nodes/vertex/2/node = SubResource("VisualShaderNodeBillboard_drqma")
|
||||
nodes/vertex/2/position = Vector2(-120, 280)
|
||||
nodes/vertex/3/node = SubResource("VisualShaderNodeInput_0eixc")
|
||||
nodes/vertex/3/position = Vector2(-300, 160)
|
||||
nodes/vertex/4/node = SubResource("VisualShaderNodeVectorCompose_mv5vw")
|
||||
nodes/vertex/4/position = Vector2(99.8642, 172.257)
|
||||
nodes/vertex/connections = PackedInt32Array(2, 0, 0, 10, 3, 0, 4, 0, 4, 0, 0, 6)
|
||||
nodes/fragment/0/position = Vector2(960, 160)
|
||||
nodes/fragment/2/node = SubResource("VisualShaderNodeTexture_fa4vl")
|
||||
nodes/fragment/2/position = Vector2(-440, 520)
|
||||
nodes/fragment/3/node = SubResource("VisualShaderNodeFloatOp_pkecw")
|
||||
nodes/fragment/3/position = Vector2(-100, 500)
|
||||
nodes/fragment/4/node = SubResource("VisualShaderNodeInput_66yqg")
|
||||
nodes/fragment/4/position = Vector2(-960, 40)
|
||||
nodes/fragment/5/node = SubResource("VisualShaderNodeUVPolarCoord_662y1")
|
||||
nodes/fragment/5/position = Vector2(-280, 80)
|
||||
nodes/fragment/6/node = SubResource("VisualShaderNodeColorFunc_tlel1")
|
||||
nodes/fragment/6/position = Vector2(-100, 80)
|
||||
nodes/fragment/7/node = SubResource("VisualShaderNodeFloatFunc_cmbe8")
|
||||
nodes/fragment/7/position = Vector2(120, 80)
|
||||
nodes/fragment/8/node = SubResource("VisualShaderNodeVectorOp_a83e8")
|
||||
nodes/fragment/8/position = Vector2(343.557, 123.867)
|
||||
nodes/fragment/9/node = SubResource("VisualShaderNodeVectorOp_w0l32")
|
||||
nodes/fragment/9/position = Vector2(622.371, 141.076)
|
||||
nodes/fragment/10/node = SubResource("VisualShaderNodeColorConstant_ncvl6")
|
||||
nodes/fragment/10/position = Vector2(480, -20)
|
||||
nodes/fragment/11/node = SubResource("VisualShaderNodeFloatConstant_ce6tx")
|
||||
nodes/fragment/11/position = Vector2(540, 340)
|
||||
nodes/fragment/12/node = SubResource("VisualShaderNodeFloatFunc_2du5f")
|
||||
nodes/fragment/12/position = Vector2(293.253, 533.22)
|
||||
nodes/fragment/13/node = SubResource("VisualShaderNodeInput_3of4b")
|
||||
nodes/fragment/13/position = Vector2(-1340, 260)
|
||||
nodes/fragment/14/node = SubResource("VisualShaderNodeVectorDecompose_50gpj")
|
||||
nodes/fragment/14/position = Vector2(-980, 260)
|
||||
nodes/fragment/15/node = SubResource("VisualShaderNodeFloatOp_u51ta")
|
||||
nodes/fragment/15/position = Vector2(-780, 300)
|
||||
nodes/fragment/16/node = SubResource("VisualShaderNodeUVFunc_d33ia")
|
||||
nodes/fragment/16/position = Vector2(-593.247, 245.06)
|
||||
nodes/fragment/17/node = SubResource("VisualShaderNodeFloatConstant_jsho4")
|
||||
nodes/fragment/17/position = Vector2(660, 460)
|
||||
nodes/fragment/connections = PackedInt32Array(2, 0, 3, 0, 4, 0, 5, 0, 5, 0, 6, 0, 6, 0, 7, 0, 7, 0, 8, 0, 3, 0, 8, 1, 8, 0, 9, 1, 10, 0, 9, 0, 9, 0, 0, 0, 11, 0, 0, 1, 3, 0, 12, 0, 12, 0, 0, 19, 13, 0, 14, 0, 14, 0, 15, 0, 4, 0, 16, 0, 15, 0, 16, 2, 16, 0, 2, 0, 17, 0, 0, 17)
|
||||
@@ -570,6 +570,10 @@ skeleton = NodePath("")
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.313464, 0.367055, 0.326287)
|
||||
shape = SubResource("ConvexPolygonShape3D_vjhcl")
|
||||
|
||||
[node name="BrokenSound" type="AudioStreamPlayer3D" parent="part1"]
|
||||
stream = ExtResource("1_ct6g4")
|
||||
autoplay = true
|
||||
|
||||
[node name="part2" type="RigidBody3D" parent="."]
|
||||
collision_layer = 2
|
||||
collision_mask = 7
|
||||
@@ -738,7 +742,3 @@ skeleton = NodePath("")
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="part14"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.400743, 0.862023, 0.231647)
|
||||
shape = SubResource("ConvexPolygonShape3D_hp35l")
|
||||
|
||||
[node name="BrokenSound" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource("1_ct6g4")
|
||||
autoplay = true
|
||||
|
||||
@@ -263,8 +263,9 @@ _surfaces = [{
|
||||
blend_shape_mode = 0
|
||||
shadow_mesh = SubResource("ArrayMesh_7g1e1")
|
||||
|
||||
[sub_resource type="ConvexPolygonShape3D" id="ConvexPolygonShape3D_7py8o"]
|
||||
points = PackedVector3Array(-0.344899, -0.0821611, -0.0326766, 0.129962, 0.244611, 0.0282392, 0.129962, 0.244611, -0.0353529, 0.935703, -0.0946573, 0.0282392, -0.357868, 0.0961252, 0.113067, -0.357868, 0.138534, -0.120203, 0.385546, -0.0930766, -0.104524, -0.108494, -0.119472, 0.102292, 0.11297, 0.17984, 0.0955212, -0.111698, -0.12099, -0.0909347, 0.073862, 0.163671, -0.104365, 0.935703, -0.0734717, -0.0141403, 0.40588, -0.0578204, 0.0987182, -0.357868, 0.138534, 0.113067, 0.596402, -0.11588, -0.0353529, -0.368993, -0.063627, 0.0257779, 0.935703, -0.0734717, 0.0282392, 0.40551, -0.0575425, -0.1056, 0.219746, -0.115, 0.0995593, -0.357868, 0.0961252, -0.120203, -0.0761913, -0.112906, -0.105416, -0.385095, -0.0265125, 0.0265326, 0.935703, -0.0946573, -0.0141403, 0.220143, -0.113207, -0.1056, 0.596402, -0.11588, 0.0282392, -0.322307, -0.0814319, 0.0447062, 0.37115, 0.0211604, -0.0932093, 0.385588, -0.0931241, 0.0974203, -0.307365, -0.0824694, -0.0521922, 0.180317, 0.145872, -0.0880433, -0.371016, -0.0247529, -0.0329882, -0.344856, -0.0821514, 0.0255589)
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_q7xl1"]
|
||||
radius = 0.214127
|
||||
height = 0.803677
|
||||
|
||||
[sub_resource type="Animation" id="Animation_rf35q"]
|
||||
resource_name = "run"
|
||||
@@ -277,10 +278,10 @@ tracks/0/path = NodePath("rat1:position")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.25, 0.5, 0.75, 1),
|
||||
"times": PackedFloat32Array(0, 0.25, 0.5, 0.76, 1),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.107148, 0.0793237, 0), Vector3(-0.107, 0.2, 0), Vector3(-0.107148, 0.0793237, 0), Vector3(-0.107, 0.15, 0), Vector3(-0.107148, 0.0793237, 0)]
|
||||
"values": [Vector3(0, 0.079, 0), Vector3(0, 0.2, 0), Vector3(0, 0.079, 0), Vector3(0, 0.15, 0), Vector3(0, 0.079, 0)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
@@ -336,14 +337,15 @@ _data = {
|
||||
"run": SubResource("Animation_rf35q")
|
||||
}
|
||||
|
||||
[node name="rat" type="RigidBody3D" groups=["breakable", "rat", "scene_rigidbody"]]
|
||||
[node name="rat" type="CharacterBody3D" groups=["breakable", "rat"]]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.117073, 0)
|
||||
collision_layer = 2
|
||||
collision_mask = 7
|
||||
script = ExtResource("1_m8jnv")
|
||||
dead_rat = ExtResource("2_it4rd")
|
||||
|
||||
[node name="rat1" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.107148, 0.0793237, 0)
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0.079, 0)
|
||||
mesh = SubResource("ArrayMesh_bpli1")
|
||||
skeleton = NodePath("")
|
||||
|
||||
@@ -373,11 +375,27 @@ mesh = SubResource("ArrayMesh_r7nw6")
|
||||
skeleton = NodePath("")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.107148, 0.0793237, 0)
|
||||
shape = SubResource("ConvexPolygonShape3D_7py8o")
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.079, 0)
|
||||
shape = SubResource("CapsuleShape3D_q7xl1")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_0gijd")
|
||||
}
|
||||
autoplay = "run"
|
||||
|
||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
||||
path_height_offset = 1.1
|
||||
avoidance_enabled = true
|
||||
|
||||
[node name="RayCast3D" type="RayCast3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0699478, -0.342128)
|
||||
target_position = Vector3(0, 0, -0.2)
|
||||
|
||||
[node name="RayCast3D2" type="RayCast3D" parent="."]
|
||||
transform = Transform3D(0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, 0, -0.0699478, -0.342128)
|
||||
target_position = Vector3(0, 0, -0.2)
|
||||
|
||||
[node name="RayCast3D3" type="RayCast3D" parent="."]
|
||||
transform = Transform3D(0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, 0.707107, 0, -0.0699478, -0.342128)
|
||||
target_position = Vector3(0, 0, -0.2)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=116 format=3 uid="uid://b7rlijqhcmkjp"]
|
||||
[gd_scene load_steps=120 format=3 uid="uid://b7rlijqhcmkjp"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cy4cwv7ppdclm" path="res://assets/Models/rat1.albedo.png" id="1_ejack"]
|
||||
[ext_resource type="Script" path="res://scripts/rat_dead.gd" id="1_gptlv"]
|
||||
@@ -7,6 +7,25 @@
|
||||
[ext_resource type="Texture2D" uid="uid://4hcotl7lxuph" path="res://assets/Models/rat1.skin.albedo.png" id="4_ul8qn"]
|
||||
[ext_resource type="Texture2D" uid="uid://dou16gpndumbw" path="res://assets/Models/rat1.viscera.albedo.png" id="5_kda7p"]
|
||||
[ext_resource type="Texture2D" uid="uid://vaym8hyreuyj" path="res://assets/Models/rat1.viscera.rough.png" id="6_x8lsy"]
|
||||
[ext_resource type="Shader" uid="uid://ddeew8xbtykrq" path="res://assets/blood.tres" id="8_pk774"]
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_2fe8o"]
|
||||
emission_shape_scale = Vector3(0.1, 0.1, 0.1)
|
||||
direction = Vector3(0, 1, 0)
|
||||
spread = 54.52
|
||||
initial_velocity_min = 1.0
|
||||
initial_velocity_max = 5.0
|
||||
damping_min = 1.0
|
||||
damping_max = 1.0
|
||||
scale_min = 2.0
|
||||
scale_max = 5.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_nd6n7"]
|
||||
render_priority = 0
|
||||
shader = ExtResource("8_pk774")
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_oe75e"]
|
||||
material = SubResource("ShaderMaterial_nd6n7")
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_w53fg"]
|
||||
resource_name = "rat1"
|
||||
@@ -2227,6 +2246,15 @@ points = PackedVector3Array(-0.00948123, 0.000167692, -0.036668, -0.00821897, 0.
|
||||
[node name="RatDead" type="Node3D" groups=["scene_rigidbody"]]
|
||||
script = ExtResource("1_gptlv")
|
||||
|
||||
[node name="GPUParticles3D" type="GPUParticles3D" parent="."]
|
||||
transform = Transform3D(1, 0, -4.65661e-10, 0, 1, 0, 4.65661e-10, 0, 1, 0, 0, 0)
|
||||
amount = 50
|
||||
lifetime = 5.0
|
||||
explosiveness = 1.0
|
||||
trail_enabled = true
|
||||
process_material = SubResource("ParticleProcessMaterial_2fe8o")
|
||||
draw_pass_1 = SubResource("QuadMesh_oe75e")
|
||||
|
||||
[node name="ratdead1" type="RigidBody3D" parent="." groups=["scene_rigidbody"]]
|
||||
transform = Transform3D(-0.00541045, 0, -0.999985, 0, 1, 0, 0.999985, 0, -0.00541045, 0, 0, 0)
|
||||
collision_layer = 2
|
||||
|
||||
@@ -21,7 +21,7 @@ rat = ExtResource("2_dih3n")
|
||||
mesh = SubResource("BoxMesh_7h30q")
|
||||
|
||||
[node name="RayCast3D" type="RayCast3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.0748563)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.356676)
|
||||
target_position = Vector3(0, 0, -1)
|
||||
|
||||
[node name="Area3D" type="Area3D" parent="."]
|
||||
|
||||
@@ -1479,9 +1479,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -56.263, 15.8115, 52.2153)
|
||||
[node name="LadderCollisionCheck" parent="." instance=ExtResource("32_hbde8")]
|
||||
transform = Transform3D(1, 0, 0, 0, 2.46246, 0, 0, 0, 1, -56.2309, 0.433904, 52.2598)
|
||||
|
||||
[node name="rat" parent="." instance=ExtResource("32_og4yo")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.123, 0.168887, 32.6325)
|
||||
|
||||
[node name="RATS" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.06322, 0.386584, 38.0795)
|
||||
script = ExtResource("33_f7t8d")
|
||||
@@ -1494,10 +1491,4 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0417337, -0.133987)
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -25.9553, 0.0330879, -30.573)
|
||||
|
||||
[node name="RatHole3" parent="RATS" instance=ExtResource("34_uuf6k")]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -17.9345, -0.015456, -30.5149)
|
||||
|
||||
[node name="RatHole4" parent="RATS" instance=ExtResource("34_uuf6k")]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -22.0695, -0.015456, -30.5149)
|
||||
|
||||
[node name="RatHole5" parent="RATS" instance=ExtResource("34_uuf6k")]
|
||||
transform = Transform3D(0.541195, 0, -0.840897, 0, 1, 0, 0.840897, 0, 0.541195, -59.4829, -0.0154541, -2.20793)
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -52.7229, 0.0330879, 14.1093)
|
||||
|
||||
@@ -37,7 +37,7 @@ func _ready():
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta):
|
||||
print(particle_number)
|
||||
pass
|
||||
|
||||
func gun_spawn(index):
|
||||
#loop around if scrolling past available guns
|
||||
|
||||
@@ -23,5 +23,9 @@ func breaking(current_velocity):
|
||||
spawn_broken.position = global_position
|
||||
spawn_broken.transform.basis = global_transform.basis
|
||||
spawn_broken.rotation = rotation
|
||||
var pieces = spawn_broken.get_children()
|
||||
for piece in pieces:
|
||||
if piece is RigidBody3D:
|
||||
piece.linear_velocity += current_velocity
|
||||
get_tree().get_root().add_child(spawn_broken)
|
||||
queue_free()
|
||||
|
||||
@@ -17,6 +17,9 @@ func breaking(current_velocity):
|
||||
spawn_broken.position = global_position
|
||||
spawn_broken.transform.basis = global_transform.basis
|
||||
spawn_broken.rotation = rotation
|
||||
|
||||
var pieces = spawn_broken.get_children()
|
||||
for piece in pieces:
|
||||
if piece is RigidBody3D:
|
||||
piece.linear_velocity += current_velocity
|
||||
get_tree().get_root().add_child(spawn_broken)
|
||||
queue_free()
|
||||
|
||||
@@ -132,7 +132,7 @@ func _physics_process(delta):
|
||||
velocity.x = direction.x * speed * .3
|
||||
else:
|
||||
velocity.y = lerp(velocity.y, -direction.z * speed, delta * 6.5)
|
||||
velocity.z = lerp(velocity.z, direction.z * speed, delta * 6.5)
|
||||
velocity.x = lerp(velocity.x, direction.x * speed, delta * 6.5)
|
||||
else:
|
||||
velocity.x = lerp(velocity.x, direction.x * speed, delta * 6.5)
|
||||
velocity.z = lerp(velocity.z, direction.z * speed, delta * 6.5)
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
extends RigidBody3D
|
||||
extends CharacterBody3D
|
||||
|
||||
|
||||
@onready var anim_player = $AnimationPlayer
|
||||
@export var dead_rat : Resource
|
||||
@export var SPEED = 7
|
||||
var end_hole
|
||||
var control_node
|
||||
var rng = RandomNumberGenerator.new()
|
||||
|
||||
@onready var anim_player = $AnimationPlayer
|
||||
@onready var nav_agent = $NavigationAgent3D
|
||||
@onready var ray = $RayCast3D
|
||||
@onready var ray_2 = $RayCast3D2
|
||||
@onready var ray_3 = $RayCast3D3
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
@@ -11,17 +20,32 @@ func _ready():
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
if end_hole != null:
|
||||
var move_direction = (end_hole.global_position - self.position).normalized()
|
||||
position += transform.basis * move_direction * delta * 7
|
||||
self.look_at(end_hole.position,Vector3.UP)
|
||||
func _physics_process(delta):
|
||||
|
||||
|
||||
# Navigation
|
||||
nav_agent.set_target_position(end_hole.global_transform.origin)
|
||||
var next_nav_point = nav_agent.get_next_path_position()
|
||||
velocity = (next_nav_point - global_transform.origin).normalized() * SPEED
|
||||
|
||||
look_at(end_hole.global_transform.origin, Vector3.UP)
|
||||
|
||||
if ray.is_colliding() or ray_2.is_colliding() or ray_3.is_colliding():
|
||||
velocity.y += 10
|
||||
|
||||
move_and_slide()
|
||||
|
||||
func breaking(bullet_velocity):
|
||||
var spawn_broken = dead_rat.instantiate()
|
||||
spawn_broken.position = global_position
|
||||
spawn_broken.transform.basis = global_transform.basis
|
||||
spawn_broken.rotation = rotation
|
||||
var bits = spawn_broken.get_children()
|
||||
for bit in bits:
|
||||
if bit is RigidBody3D:
|
||||
bit.linear_velocity += bullet_velocity
|
||||
if bit is GPUParticles3D:
|
||||
bit.emitting = true
|
||||
var pieces = spawn_broken.get_children()
|
||||
get_tree().get_root().add_child(spawn_broken)
|
||||
queue_free()
|
||||
|
||||
Reference in New Issue
Block a user