So first what is the goal of my code?
Helicopter 1 fires a rocket on helicopter 2. In flight the rocket shoots a ray onto the target helicopter. Now i want helicopter 2 to recognize when a rocket is flying towards him so i wrote this:
if(Physics.Raycast(transform.position, fwd, out hit))
{
hit.collider.gameObject.GetComponent
↧