Compare commits

...

7 Commits

Author SHA1 Message Date
Sri Sham Haran 0f7d86543f Fix adaptive bgm not changing on alert 2023-04-02 18:16:25 +08:00
Glence 8ffca03f16 AI fix 2023-04-02 13:32:21 +08:00
XiaoQiDigipen 724f8ae2cf
Merge pull request #456 from SHADE-DP/Navigation
adjusted hitbox timing
2023-04-02 12:48:39 +08:00
maverickdgg f495dfe4fd adjusted hitbox timing 2023-04-02 12:34:47 +08:00
Glence e5c8f4c380 fix camera jittering 2023-04-01 21:30:18 +08:00
Glence f114a7f59a Scene changes for level preview 2023-04-01 21:06:12 +08:00
XiaoQiDigipen 273bdfcdcc
Merge pull request #455 from SHADE-DP/PlayerController
bug fixes
2023-04-01 19:18:29 +08:00
7 changed files with 21 additions and 14 deletions

View File

@ -8832,7 +8832,7 @@
- Type: SHADE_Scripting.UI.PreviewLevel - Type: SHADE_Scripting.UI.PreviewLevel
Enabled: true Enabled: true
levelTransistion: 619 levelTransistion: 619
endPoint1: [-5.5, 1.5, -2] endPoint1: [-5.5, 1.20000005, -2]
endPoint2: [1, 1.5, -7.5] endPoint2: [1, 1.5, -7.5]
endPoint3: [2.5, 1.5, -3] endPoint3: [2.5, 1.5, -3]
playerCamera: 65730 playerCamera: 65730
@ -8844,7 +8844,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -7.5, y: 1.5, z: -2} Translate: {x: -7.5, y: 1.20000005, z: -2}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true

View File

@ -17095,7 +17095,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -5, y: 1.5, z: -3} Translate: {x: -4.5, y: 1.5, z: -3.5}
Rotate: {x: 0, y: -2.3561945, z: 0} Rotate: {x: 0, y: -2.3561945, z: 0}
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true

View File

@ -9383,7 +9383,7 @@
levelTransistion: 229 levelTransistion: 229
endPoint1: [-1.79999995, 1.5, 0.5] endPoint1: [-1.79999995, 1.5, 0.5]
endPoint2: [5, 3.5, 0.5] endPoint2: [5, 3.5, 0.5]
endPoint3: [-0.5, 1.5, 3.5] endPoint3: [0.5, 1.5, 0.5]
playerCamera: 66063 playerCamera: 66063
gameplayCanvas: 66062 gameplayCanvas: 66062
duration: 3 duration: 3
@ -9437,14 +9437,14 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 3.5, y: 1.5, z: 0} Translate: {x: 5.5, y: 1.5, z: 0.5}
Rotate: {x: 0, y: 2.26892805, z: 0} Rotate: {x: 0, y: 1.57079637, z: 0}
Scale: {x: 0.999999821, y: 1, z: 0.999999821} Scale: {x: 0.999999821, y: 1, z: 0.999999821}
IsActive: true IsActive: true
Camera Component: Camera Component:
Position: {x: 2.5, y: 1.5, z: -7.5} Position: {x: 2.5, y: 1.5, z: -7.5}
Pitch: 0 Pitch: 0
Yaw: 130 Yaw: 90
Roll: 0 Roll: 0
Width: 1920 Width: 1920
Near: 0.00999999978 Near: 0.00999999978

View File

@ -50,13 +50,15 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework
protected override void onTriggerStay(CollisionInfo info) protected override void onTriggerStay(CollisionInfo info)
{ {
if(info.GameObject.GetScript<PlayerController>()) if (info.GameObject.GetScript<PlayerController>())
{
pc = info.GameObject.GetScript<PlayerController>(); pc = info.GameObject.GetScript<PlayerController>();
if (ai && ai.atk && pc) if (ai && ai.atk && pc)
{ {
raccoonFound = true; raccoonFound = true;
} }
} }
}
} }

View File

@ -52,7 +52,7 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
} }
} }
SHADE.Audio.SetParameterWithLabel("PlayerDetection", "Detected");
} }
public override void OnExit() public override void OnExit()

View File

@ -88,7 +88,7 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
public override void update() public override void update()
{ {
if (ai.hitboxScript.raccoonFound) if (ai.hitboxScript.raccoonFound && machine.GetScript<HomeOwnerAI>().atk)
{ {
raccoonCaught = true; raccoonCaught = true;
Transform pcTransform = ai.player.GetComponent<Transform>(); Transform pcTransform = ai.player.GetComponent<Transform>();
@ -128,7 +128,7 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
else if (seq) else if (seq)
{ {
if (timer <= 1.0f / 30.0f) if (timer <= seqTime * 0.5f)
{ {
//ai.attackHitbox.SetActive(true); //ai.attackHitbox.SetActive(true);
machine.GetScript<HomeOwnerAI>().atk = true; machine.GetScript<HomeOwnerAI>().atk = true;

View File

@ -471,6 +471,9 @@ public class PlayerController : Script
private void Gravity() private void Gravity()
{ {
if (currentState == RaccoonStates.CAUGHT)
return;
if (rb != null) if (rb != null)
{ {
//check player vel.y if its close to zero its on the ground //check player vel.y if its close to zero its on the ground
@ -554,6 +557,7 @@ public class PlayerController : Script
rb.ClearTorque(); rb.ClearTorque();
rb.LinearVelocity = Vector3.Zero; rb.LinearVelocity = Vector3.Zero;
rb.AngularVelocity = Vector3.Zero; rb.AngularVelocity = Vector3.Zero;
collider.GetCollisionShape(0).IsTrigger = true;
} }
public void Reset() public void Reset()
@ -565,6 +569,7 @@ public class PlayerController : Script
if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState))) if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState)))
stateMachine.SetState(typeof(PlayerIdleState)); stateMachine.SetState(typeof(PlayerIdleState));
collider.GetCollisionShape(0).IsTrigger = false;
tranform.GlobalPosition = respawnPoint.GetComponent<Transform>().GlobalPosition; tranform.GlobalPosition = respawnPoint.GetComponent<Transform>().GlobalPosition;
GameManager.Instance.RacoonCaught(); GameManager.Instance.RacoonCaught();