Missile is launched by helicopter.
But missile move randomly .
I want to that missile and helicopter have to same alignment and missile have to move linearly.
Set the missiles forward vector to that of the heli, then move it forward:
on missile spawn:
missile.transform.forward = helicopter.transform.forward;
in your update loop:
missile.transform.position += missile.transform.forward * speed;
Don’t forget to factor in Time.deltaTime on that update movement to keep it smooth on varied framerates.
Good point! Also, this is just one of many, many ways to move an object; e.g. if you want to use physics/collision, you’ll probably want to set velocity on the rigidbody in FixedUpdate instead of setting .position every frame.
Thanks dude.I will try your advices.