Raccoon animation and scene changes #415

Merged
glencelow merged 16 commits from PlayerController into main 2023-03-10 17:28:16 +08:00
4 changed files with 26 additions and 13 deletions
Showing only changes of commit 2eee1d4ab7 - Show all commits

View File

@ -2419,7 +2419,7 @@
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Rotate: {x: -1.48352981, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
@ -4107,7 +4107,7 @@
Collider Component:
Colliders:
- Is Trigger: false
Collision Tag: 0
Collision Tag: 1
Type: Box
Half Extents: {x: 20, y: 0.100000001, z: 20}
Friction: 0.400000006
@ -4299,6 +4299,8 @@
Enabled: true
Score: 50
currCategory: 1
returnBack: false
firstPostion: [0, 0, 0]
density: 1
dontReturn: false
soundDistance: 10
@ -4311,7 +4313,7 @@
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 3.22328258, y: 1.02709854, z: -0.57395637}
Translate: {x: 3.22328258, y: 1.11577427, z: -0.57395637}
Rotate: {x: 5.62993963e-09, y: -7.03049191e-17, z: -1.92319405e-08}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
@ -4351,6 +4353,8 @@
Enabled: true
Score: 500
currCategory: 2
returnBack: false
firstPostion: [0, 0, 0]
density: 1
dontReturn: false
soundDistance: 10
@ -4403,6 +4407,8 @@
Enabled: true
Score: 10
currCategory: 0
returnBack: false
firstPostion: [0, 0, 0]
density: 1
dontReturn: false
soundDistance: 10
@ -4455,6 +4461,8 @@
Enabled: true
Score: 10
currCategory: 0
returnBack: false
firstPostion: [0, 0, 0]
density: 1
dontReturn: false
soundDistance: 10
@ -4804,7 +4812,7 @@
IsActive: true
Animator Component:
Rig: 72178939
Clip: 72178939
AnimationController: 0
IsActive: true
Scripts: ~
- EID: 219
@ -4823,7 +4831,7 @@
IsActive: true
Animator Component:
Rig: 80728853
Clip: 80728853
AnimationController: 0
IsActive: true
Scripts: ~
- EID: 218
@ -4842,7 +4850,7 @@
IsActive: true
Animator Component:
Rig: 80500944
Clip: 80500944
AnimationController: 0
IsActive: true
Scripts: ~
- EID: 220
@ -4861,7 +4869,7 @@
IsActive: true
Animator Component:
Rig: 76715962
Clip: 76715962
AnimationController: 0
IsActive: true
Scripts: ~
- EID: 198

View File

@ -156,7 +156,7 @@ public partial class LeafSearch : BehaviourTreeNode
//Draw a ray, succeed if ray is unobstructed
Vector3 eyePosition = transform.GlobalPosition + eyeOffset;
BoxCollider playerCollider = player.GetValueOrDefault().GetComponent<Collider>().GetCollisionShape<BoxCollider>(0);
Collider playerCollider = player.GetValueOrDefault().GetComponent<Collider>();
if (playerCollider == null)
{
//Debug.Log("Failure: Player has no collider");
@ -167,7 +167,7 @@ public partial class LeafSearch : BehaviourTreeNode
}
//Ray destination to target the centre of the player's collider instead of transform position
//Since transform position is often the raccoon's base and the ray needs to hit somewhere higher to be more reliable
Vector3 rayDestination = plrT.GlobalPosition + plrT.GlobalScale * playerCollider.PositionOffset;
Vector3 rayDestination = plrT.GlobalPosition + plrT.GlobalScale * playerCollider.GetCollisionShape(0).PositionOffset;
Ray sightRay = new Ray(eyePosition, rayDestination - eyePosition);
RaycastHit sightRayHit = Physics.Raycast(sightRay, false, (ushort)65535)[0];
//As of November 2022, RaycastHit contains only the FIRST object hit by

View File

@ -86,12 +86,17 @@ public class Item : Script
if (returnBack && !dontReturn)
{
if (rb)
{
rb.LinearVelocity = Vector3.Zero;
rb.AngularVelocity = Vector3.Zero;
rb.ClearForces();
rb.ClearTorque();
}
if(transform)
transform.LocalPosition = firstPostion;
if (rb)
rb.LinearVelocity = Vector3.Zero;
returnBack = false;
}

View File

@ -280,7 +280,7 @@ namespace SHADE
if (arm->lookAtCameraOrigin)
CameraLookAt(camera, camera.position + arm->GetTargetOffset());
CameraLookAt(camera, camera.position + tOffset);
}