kimnguyen95
Member
Hi,
I'm trying to fire a Projectile by myself. Here is my steps:
1. I instantiate the prefab using ObjectPoolBase
2. Call the Initialize function.
But the projectile can collider with my character ( because there are decals on the character collider). However, my projectile takes no damage, please see the screenshot for my damage LayerMask.
Hope anyone can help me to solve it.
Thank you,
I'm trying to fire a Projectile by myself. Here is my steps:
1. I instantiate the prefab using ObjectPoolBase
2. Call the Initialize function.
But the projectile can collider with my character ( because there are decals on the character collider). However, my projectile takes no damage, please see the screenshot for my damage LayerMask.
Hope anyone can help me to solve it.
Thank you,
GameObject g = ObjectPoolBase.Instantiate(BulletPrefab, SoldierParticle.transform.position,
Quaternion.LookRotation(target
- SoldierParticle.transform.position)
) as GameObject;
Projectile projectile = g.GetComponent<Projectile>();
projectile.Initialize( projectile.transform.forward*15, Vector3.zero, gameObject );