mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-14 16:27:19 +00:00
ignore collision between shooter ped and projectile
This commit is contained in:
parent
ec89abedd8
commit
1ca4b2d0ad
2 changed files with 12 additions and 2 deletions
|
@ -23,7 +23,12 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
|
||||
public static Projectile Create(
|
||||
GameObject prefab, Vector3 position, Quaternion rotation, AudioClip audioClip, Geometry.GeometryParts model)
|
||||
GameObject prefab,
|
||||
Vector3 position,
|
||||
Quaternion rotation,
|
||||
AudioClip audioClip,
|
||||
Geometry.GeometryParts model,
|
||||
Ped shooterPed)
|
||||
{
|
||||
var go = Instantiate(prefab, position, rotation);
|
||||
|
||||
|
@ -35,6 +40,11 @@ namespace SanAndreasUnity.Behaviours
|
|||
projectile.m_audioSource.Play();
|
||||
}
|
||||
|
||||
if (shooterPed != null)
|
||||
{
|
||||
Physics.IgnoreCollision(shooterPed.characterController, projectile.GetComponentOrThrow<Collider>());
|
||||
}
|
||||
|
||||
if (model != null)
|
||||
{
|
||||
model.AttachFrames(projectile.m_modelAttachTransform, MaterialFlags.Default);
|
||||
|
|
|
@ -651,7 +651,7 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
if (this.FiresProjectile)
|
||||
{
|
||||
Projectile.Create(this.ProjectilePrefab, firePos, Quaternion.LookRotation(fireDir), null, m_projectileModel);
|
||||
Projectile.Create(this.ProjectilePrefab, firePos, Quaternion.LookRotation(fireDir), null, m_projectileModel, m_ped);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue