Fix colour changing

This commit is contained in:
Spencer Killen 2023-08-20 13:24:04 -06:00
parent c1cd31bc81
commit aac237f44b
Signed by: sjkillen
GPG Key ID: F307025B65C860BA
4 changed files with 18 additions and 17 deletions

View File

@ -154,7 +154,7 @@ transform = Transform3D(0.065, 0, 0, 0, 0.065, 0, 0, 0, 0.065, 0, 0, 0)
script = ExtResource("2_ksje8") script = ExtResource("2_ksje8")
[node name="Skeleton3D" parent="rig" index="0"] [node name="Skeleton3D" parent="rig" index="0"]
bones/0/rotation = Quaternion(0.100612, 0, 0, 0.994926) bones/0/rotation = Quaternion(0.0617842, 0, 0, 0.99809)
bones/1/rotation = Quaternion(-0.0891896, 1.18734e-07, -1.06322e-08, 0.996015) bones/1/rotation = Quaternion(-0.0891896, 1.18734e-07, -1.06322e-08, 0.996015)
bones/2/rotation = Quaternion(0.0133933, -1.19199e-07, 1.5966e-09, 0.99991) bones/2/rotation = Quaternion(0.0133933, -1.19199e-07, 1.5966e-09, 0.99991)
bones/3/rotation = Quaternion(-0.00997737, 0.100365, -0.694951, 0.711948) bones/3/rotation = Quaternion(-0.00997737, 0.100365, -0.694951, 0.711948)
@ -195,4 +195,4 @@ stream = ExtResource("6_qe4bi")
stream = ExtResource("6_qe4bi") stream = ExtResource("6_qe4bi")
[node name="footstep" type="AudioStreamPlayer" parent="." index="9"] [node name="footstep" type="AudioStreamPlayer" parent="." index="9"]
volume_db = -10.0 volume_db = -17.0

View File

@ -6,6 +6,8 @@ const JUMP_VELOCITY = 4.5
@export var horiz_sens = 0.25 @export var horiz_sens = 0.25
@export var vert_sens = 0.25 @export var vert_sens = 0.25
var LOWER_CAMERA_LIMIT = -60
var UPPER_CAMERA_LIMIT = -11
var target: WeakRef = weakref(null) var target: WeakRef = weakref(null)
var holding: WeakRef = weakref(null) var holding: WeakRef = weakref(null)
@ -15,7 +17,7 @@ var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")
func _ready(): func _ready():
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
$CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(-60), deg_to_rad(-11)) $CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(LOWER_CAMERA_LIMIT), deg_to_rad(UPPER_CAMERA_LIMIT))
func _process(_delta): func _process(_delta):
@ -33,7 +35,7 @@ func _process(_delta):
$CameraMount.rotate_x(deg_to_rad(-event.y * vert_sens)) $CameraMount.rotate_x(deg_to_rad(-event.y * vert_sens))
var roty = deg_to_rad(event.x * horiz_sens) var roty = deg_to_rad(event.x * horiz_sens)
$grape_man.rotate_y(roty) $grape_man.rotate_y(roty)
$CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(-60), deg_to_rad(-11)) $CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(LOWER_CAMERA_LIMIT), deg_to_rad(UPPER_CAMERA_LIMIT))
func _input(event): func _input(event):
@ -43,15 +45,7 @@ func _input(event):
$CameraMount.rotate_x(deg_to_rad(-event.relative.y * vert_sens)) $CameraMount.rotate_x(deg_to_rad(-event.relative.y * vert_sens))
var roty = deg_to_rad(event.relative.x * horiz_sens) var roty = deg_to_rad(event.relative.x * horiz_sens)
$grape_man.rotate_y(roty) $grape_man.rotate_y(roty)
$CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(-60), deg_to_rad(-11)) $CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(LOWER_CAMERA_LIMIT), deg_to_rad(UPPER_CAMERA_LIMIT))
if event is InputEventMouseMotion:
rotate_y(deg_to_rad(-event.relative.x * horiz_sens))
$CameraMount.rotate_x(deg_to_rad(-event.relative.y * vert_sens))
var roty = deg_to_rad(event.relative.x * horiz_sens)
$grape_man.rotate_y(roty)
$CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(-60), deg_to_rad(-11))

View File

@ -21,10 +21,10 @@ shape = SubResource("CapsuleShape3D_kb4ms")
[node name="grape_man" parent="." instance=ExtResource("2_ctyy5")] [node name="grape_man" parent="." instance=ExtResource("2_ctyy5")]
[node name="CameraMount" type="Node3D" parent="."] [node name="CameraMount" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.3, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.389874, 0)
[node name="PlayerCam" type="Camera3D" parent="CameraMount"] [node name="PlayerCam" type="Camera3D" parent="CameraMount"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.39043) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.643936)
current = true current = true
fov = 50.0 fov = 50.0

View File

@ -3,8 +3,15 @@
[ext_resource type="PackedScene" uid="uid://dmtmign72vtlm" path="res://slime_shared.tscn" id="1_qm1jp"] [ext_resource type="PackedScene" uid="uid://dmtmign72vtlm" path="res://slime_shared.tscn" id="1_qm1jp"]
[ext_resource type="Script" path="res://Villager.gd" id="2_uf6mh"] [ext_resource type="Script" path="res://Villager.gd" id="2_uf6mh"]
[sub_resource type="SphereShape3D" id="SphereShape3D_0wi6w"] [sub_resource type="SphereShape3D" id="SphereShape3D_uj6ya"]
radius = 0.1 radius = 0.193616
[node name="villager" instance=ExtResource("1_qm1jp")] [node name="villager" instance=ExtResource("1_qm1jp")]
script = ExtResource("2_uf6mh") script = ExtResource("2_uf6mh")
[node name="Area3D" type="Area3D" parent="." index="2"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D" index="0"]
shape = SubResource("SphereShape3D_uj6ya")
[connection signal="body_entered" from="Area3D" to="." method="_on_area_3d_body_entered"]