Fix invisble bullets
This commit is contained in:
parent
35cbd78568
commit
d7c3b41189
@ -68,6 +68,7 @@ public class CannonScript : MonoBehaviour
|
||||
proj = Instantiate(projectile, cannon.transform.position, cannon.transform.rotation);
|
||||
proj.GetComponent<Projectile>().SetDamage(damage);
|
||||
proj.GetComponent<Rigidbody>().AddForce(cannonForce * (lookDir+offsets[i]), ForceMode.Impulse);
|
||||
proj.layer = GameManager.Instance.GetCurrentLayerID();
|
||||
if (Physics.Raycast(transform.position, (lookDir+offsets[i]), out hit, Mathf.Infinity))
|
||||
{
|
||||
Debug.DrawRay(transform.position, (lookDir+offsets[i]) * hit.distance, Color.yellow, 0.5f);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user