mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-17 05:18:27 +00:00
modify strength of explosion based on vehicle mass
This commit is contained in:
parent
44fe30d8df
commit
2e02d0dab2
1 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
using System.Linq;
|
||||
using SanAndreasUnity.Utilities;
|
||||
using UnityEngine;
|
||||
using UnityStandardAssets.Effects;
|
||||
|
||||
namespace SanAndreasUnity.Behaviours.Vehicles
|
||||
{
|
||||
|
@ -182,7 +183,10 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
|
||||
// create explosion effect
|
||||
|
||||
Object.Instantiate(VehicleManager.Instance.explosionPrefab, this.transform.position, this.transform.rotation);
|
||||
GameObject explosionGo = Object.Instantiate(VehicleManager.Instance.explosionPrefab, this.transform.position, this.transform.rotation);
|
||||
|
||||
// modify strength of explosion based on vehicle mass
|
||||
explosionGo.GetComponentOrThrow<ExplosionPhysicsForce>().explosionForce *= this.HandlingData.Mass / 1500f;
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue