mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-22 03:53:04 +00:00
ignore collision between projectiles
This commit is contained in:
parent
852b198ab1
commit
f04728934e
8 changed files with 21 additions and 15 deletions
|
@ -23342,6 +23342,9 @@ MonoBehaviour:
|
|||
upwardsModifier: 2.5
|
||||
radius: 10
|
||||
explosionMultiplier: 1
|
||||
layerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 15105
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
@ -146,13 +146,13 @@ MonoBehaviour:
|
|||
showPedSpeedometer: 1
|
||||
groundFindingIgnoredLayerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 14902
|
||||
m_Bits: 31286
|
||||
cameraDistanceFromPed: 4
|
||||
minCameraDistanceFromPed: 2
|
||||
maxCameraDistanceFromPed: 30
|
||||
cameraRaycastIgnoredLayerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 15158
|
||||
m_Bits: 31542
|
||||
legAndArmDamageMultiplier: 0.8
|
||||
stomachAndChestDamageMultiplier: 1
|
||||
headDamageMultiplier: 4
|
||||
|
|
|
@ -11,7 +11,7 @@ GameObject:
|
|||
- component: {fileID: 7991730905356042406}
|
||||
- component: {fileID: 8654847074425390642}
|
||||
- component: {fileID: 1859652892926530849}
|
||||
m_Layer: 0
|
||||
m_Layer: 14
|
||||
m_Name: Model
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
|
@ -4594,7 +4594,7 @@ GameObject:
|
|||
- component: {fileID: 223436154079187918}
|
||||
- component: {fileID: 5633959673307472571}
|
||||
- component: {fileID: 1740834482409443228}
|
||||
m_Layer: 0
|
||||
m_Layer: 14
|
||||
m_Name: Projectile
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
|
@ -4632,9 +4632,6 @@ MonoBehaviour:
|
|||
explosionDamageAmount: 1500
|
||||
explosionDamageRadius: 7
|
||||
particleSystemMultiplier: 1
|
||||
collisionLayerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
speed: 15
|
||||
rotationSpeed: 720
|
||||
lifeTime: 20
|
||||
|
|
|
@ -23342,6 +23342,9 @@ MonoBehaviour:
|
|||
upwardsModifier: 2.5
|
||||
radius: 10
|
||||
explosionMultiplier: 1
|
||||
layerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 15105
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
@ -15,7 +15,6 @@ namespace SanAndreasUnity.Behaviours
|
|||
public float explosionDamageAmount = 1000;
|
||||
public float explosionDamageRadius = 5;
|
||||
public float particleSystemMultiplier = 1;
|
||||
public LayerMask collisionLayerMask;
|
||||
public float speed = 10;
|
||||
public float rotationSpeed = 180;
|
||||
public float lifeTime = 30;
|
||||
|
@ -46,7 +45,12 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
if (shooterPed != null)
|
||||
{
|
||||
Physics.IgnoreCollision(shooterPed.characterController, projectile.GetComponentOrThrow<Collider>());
|
||||
var projectileCollider = projectile.GetComponentOrThrow<Collider>();
|
||||
var pedColliders = shooterPed.GetComponentsInChildren<Collider>();
|
||||
foreach (var pedCollider in pedColliders)
|
||||
{
|
||||
Physics.IgnoreCollision(pedCollider, projectileCollider);
|
||||
}
|
||||
}
|
||||
|
||||
if (model != null)
|
||||
|
@ -80,9 +84,6 @@ namespace SanAndreasUnity.Behaviours
|
|||
if (m_alreadyExploded)
|
||||
return;
|
||||
|
||||
if (((1 << other.gameObject.layer) & this.collisionLayerMask.value) == 0)
|
||||
return;
|
||||
|
||||
m_alreadyExploded = true;
|
||||
|
||||
Object.Destroy(this.gameObject);
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace SanAndreasUnity.Utilities
|
|||
public float upwardsModifier = 1f;
|
||||
public float radius = 10f;
|
||||
public float explosionMultiplier = 1f;
|
||||
public LayerMask layerMask;
|
||||
|
||||
|
||||
private IEnumerator Start()
|
||||
|
@ -22,7 +23,7 @@ namespace SanAndreasUnity.Utilities
|
|||
float multiplier = this.explosionMultiplier;
|
||||
|
||||
float r = radius * multiplier;
|
||||
var cols = Physics.OverlapSphere(this.transform.position, r);
|
||||
var cols = Physics.OverlapSphere(this.transform.position, r, layerMask);
|
||||
|
||||
var rigidbodies = new Dictionary<Rigidbody, List<Collider>>();
|
||||
foreach (var col in cols)
|
||||
|
|
|
@ -17,7 +17,7 @@ PhysicsManager:
|
|||
m_ClothInterCollisionDistance: 0
|
||||
m_ClothInterCollisionStiffness: 0
|
||||
m_ContactsGeneration: 1
|
||||
m_LayerCollisionMatrix: ffcfffffffcfffffffcfffffffffffffffcfffffffcfffffffffffffffffffffffcfffffffc7ffffffcfffffffcdffffc8c0ffffc8c0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
m_LayerCollisionMatrix: ffcfffffffcfffffffcfffffffffffffffcfffffffcfffffffffffffffffffffffcfffffff87ffffffcfffffff8dffffc8c0ffffc8c0ffffffb5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
m_AutoSimulation: 1
|
||||
m_AutoSyncTransforms: 1
|
||||
m_ReuseCollisionCallbacks: 0
|
||||
|
|
|
@ -6,6 +6,7 @@ TagManager:
|
|||
tags:
|
||||
- Minimap
|
||||
- UI
|
||||
- Fire
|
||||
layers:
|
||||
- Default
|
||||
- TransparentFX
|
||||
|
@ -21,7 +22,7 @@ TagManager:
|
|||
- Player
|
||||
- PedBone
|
||||
- VehicleMesh
|
||||
-
|
||||
- Projectile
|
||||
-
|
||||
-
|
||||
-
|
||||
|
|
Loading…
Reference in a new issue