added physics fix and raycast change

called clear container in physicsSystem
move raycast of player higher
This commit is contained in:
Glence 2023-02-04 15:17:58 +08:00
parent f2602207aa
commit a594df5a4d
4 changed files with 30 additions and 28 deletions

View File

@ -3437,7 +3437,7 @@
Components: Components:
Transform Component: Transform Component:
Translate: {x: -0.0670871735, y: 0, z: 0.236379623} Translate: {x: -0.0670871735, y: 0, z: 0.236379623}
Rotate: {x: 0, y: -0.785398245, z: 0} Rotate: {x: -0, y: -0.785398245, z: 0}
Scale: {x: 1.49995053, y: 1, z: 1.49995029} Scale: {x: 1.49995053, y: 1, z: 1.49995029}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
@ -8588,7 +8588,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -1.74228501, y: 0.927017033, z: -1.76112592} Translate: {x: -1.87913799, y: 0.927017033, z: -1.85982084}
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
@ -8672,7 +8672,7 @@
Scripts: Scripts:
- Type: Item - Type: Item
Enabled: true Enabled: true
Score: 100 Score: 500
currCategory: 2 currCategory: 2
density: 1 density: 1
dontReturn: false dontReturn: false
@ -8719,7 +8719,7 @@
Scripts: Scripts:
- Type: Item - Type: Item
Enabled: true Enabled: true
Score: 100 Score: 500
currCategory: 2 currCategory: 2
density: 1 density: 1
dontReturn: false dontReturn: false
@ -8766,7 +8766,7 @@
Scripts: Scripts:
- Type: Item - Type: Item
Enabled: true Enabled: true
Score: 100 Score: 500
currCategory: 2 currCategory: 2
density: 1 density: 1
dontReturn: false dontReturn: false
@ -8954,9 +8954,9 @@
Scripts: Scripts:
- Type: Breakable - Type: Breakable
Enabled: true Enabled: true
threshHold: 5 threshHold: 4
ignoreRaccoon: true ignoreRaccoon: true
print: false print: true
- Type: Item - Type: Item
Enabled: true Enabled: true
Score: 500 Score: 500
@ -8969,7 +8969,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -0.0219824314, y: 2.77459621e-05, z: 0.140744686} Translate: {x: -0.0219824314, y: 2.77757645e-05, z: 0.140745163}
Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true
@ -9006,9 +9006,9 @@
Scripts: Scripts:
- Type: Item - Type: Item
Enabled: true Enabled: true
Score: 10 Score: 50
currCategory: 1 currCategory: 1
density: 5 density: 3
dontReturn: false dontReturn: false
- EID: 131219 - EID: 131219
Name: Piece2 Name: Piece2
@ -9016,7 +9016,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0.0213363171, y: 0.0825135708, z: -0.0573720932} Translate: {x: 0.0213363171, y: 0.0825136006, z: -0.0573720932}
Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true
@ -9053,9 +9053,9 @@
Scripts: Scripts:
- Type: Item - Type: Item
Enabled: true Enabled: true
Score: 10 Score: 50
currCategory: 1 currCategory: 1
density: 5 density: 3
dontReturn: false dontReturn: false
- EID: 131221 - EID: 131221
Name: Piece3 Name: Piece3
@ -9063,7 +9063,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -0.0268242359, y: -0.140726641, z: -0.0336794853} Translate: {x: -0.0268241167, y: -0.140726611, z: -0.0336794853}
Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true
@ -9101,8 +9101,8 @@
- Type: Item - Type: Item
Enabled: true Enabled: true
Score: 10 Score: 10
currCategory: 1 currCategory: 0
density: 5 density: 3
dontReturn: false dontReturn: false
- EID: 145 - EID: 145
Name: Piece4 Name: Piece4
@ -9110,7 +9110,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -0.194803953, y: -0.0580093563, z: -0.00789308548} Translate: {x: -0.194803953, y: -0.0580093265, z: -0.00789308548}
Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true
@ -9148,8 +9148,8 @@
- Type: Item - Type: Item
Enabled: true Enabled: true
Score: 10 Score: 10
currCategory: 1 currCategory: 0
density: 5 density: 3
dontReturn: false dontReturn: false
- EID: 196754 - EID: 196754
Name: Piece5 Name: Piece5
@ -9157,7 +9157,7 @@
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: -0.0839636326, y: 0.175804704, z: 0.0484313965} Translate: {x: -0.0839636326, y: 0.175804704, z: 0.0484318733}
Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16} Rotate: {x: 0, y: 3.6088712e-09, z: 1.97286229e-16}
Scale: {x: 1, y: 1, z: 1} Scale: {x: 1, y: 1, z: 1}
IsActive: true IsActive: true
@ -9195,8 +9195,8 @@
- Type: Item - Type: Item
Enabled: true Enabled: true
Score: 10 Score: 10
currCategory: 1 currCategory: 0
density: 5 density: 3
dontReturn: false dontReturn: false
- EID: 144 - EID: 144
Name: Egg Name: Egg
@ -9241,7 +9241,7 @@
Scripts: Scripts:
- Type: Breakable - Type: Breakable
Enabled: true Enabled: true
threshHold: 1.5 threshHold: 0.5
ignoreRaccoon: true ignoreRaccoon: true
print: false print: false
- Type: Item - Type: Item
@ -9678,12 +9678,12 @@
heavyMultiper: 0.25 heavyMultiper: 0.25
- Type: PickAndThrow - Type: PickAndThrow
Enabled: true Enabled: true
throwForce: [8, 10, 8] throwForce: [10, 8, 10]
cameraArmOffSet: [0, 0.25, 0] cameraArmOffSet: [0, 0.25, 0]
delayTimer: 1 delayTimer: 1
aimingLength: 1 aimingLength: 1
throwItem: false throwItem: false
rayDistance: 0.5 rayDistance: 0.75
- EID: 3 - EID: 3
Name: HoldingPoint Name: HoldingPoint
IsActive: true IsActive: true
@ -9732,7 +9732,7 @@
turnSpeedYaw: 0.5 turnSpeedYaw: 0.5
pitchClamp: 45 pitchClamp: 45
inverseXControls: false inverseXControls: false
inverseYControls: false inverseYControls: true
lowerClamp: 5 lowerClamp: 5
- EID: 9 - EID: 9
Name: PlayerBag Name: PlayerBag

View File

@ -23,6 +23,7 @@ public class Item : Script
public float density = 1.0f; public float density = 1.0f;
public bool dontReturn = false; public bool dontReturn = false;
protected override void awake() protected override void awake()
{ {
transform = GetComponent<Transform>(); transform = GetComponent<Transform>();
@ -73,7 +74,7 @@ public class Item : Script
playSound = false; playSound = false;
} }
if (info.GameObject.GetScript<Homeowner1>()) if (info.GameObject.GetScript<Homeowner1>() && !returnBack)
{ {
returnBack = true; returnBack = true;
} }

View File

@ -205,7 +205,7 @@ public class PickAndThrow : Script
{ {
Vector3 dirNor = pc.tranform.Forward; Vector3 dirNor = pc.tranform.Forward;
Vector3 playerRayPos = pc.tranform.GlobalPosition; Vector3 playerRayPos = pc.tranform.GlobalPosition;
playerRayPos.y += 0.05f; playerRayPos.y += 0.25f;
dirNor.Normalise(); dirNor.Normalise();
List<RaycastHit> rayList1 = Physics.Raycast(new Ray(playerRayPos, Vector3.RotateY(dirNor, SHADE.Math.DegreesToRadians(22.5f))), rayDistance, false, (ushort)65535); List<RaycastHit> rayList1 = Physics.Raycast(new Ray(playerRayPos, Vector3.RotateY(dirNor, SHADE.Math.DegreesToRadians(22.5f))), rayDistance, false, (ushort)65535);
List<RaycastHit> rayList2 = Physics.Raycast(new Ray(playerRayPos, Vector3.RotateY(dirNor, SHADE.Math.DegreesToRadians(-22.5f))), rayDistance, false, (ushort)65535); List<RaycastHit> rayList2 = Physics.Raycast(new Ray(playerRayPos, Vector3.RotateY(dirNor, SHADE.Math.DegreesToRadians(-22.5f))), rayDistance, false, (ushort)65535);

View File

@ -239,6 +239,7 @@ namespace SHADE
// Unlink with managers // Unlink with managers
objectManager.SetPhysicsWorld(nullptr); objectManager.SetPhysicsWorld(nullptr);
collisionListener.ClearContainers();
return onSceneExitEvent.get()->handle; return onSceneExitEvent.get()->handle;
} }