Trajectory problem with addforce coordinates

The basic tenant is to ‘Fire and forget’…
No matter where I turn the projectile should remain on target.

I fire a projectile in a GameObject. It travels away from the viewer towards a target in the distance. When I spin the GameObject on the x or y axis, the projectile’s postion spins with the environment. In other words the projectile is heading towards the target. When I stop the GameObject from spinning the original trajectory takes over and the projectile is once again going away from the viewer when it should maintain it’s course towards the original target. So the position of the projectile follows the GameObject’s positioning but the trajectory does not maintain course.
I could call this a feature, but I need a realistic play at first. It is always away from the viewer or if it hits something and bounces off that is the new trajectory even though the world is rotating.
I believe I am mixing component/local values with world values although I am not sure what to check.
Has anybody else seen this?


The GameObject is a GameObject not a rigidbody.
The projectile is

  var Pulsarshoot = Instantiate(Pulsarshoot,  GameObject.Find("SpawnPoint").transform.position,Quaternion.identity);
  Pulsarshoot.rigidbody.AddForce(transform.forward * 50000);
  Pulsarshoot.transform.parent = GameObject.Find("cueb").transform;
as a rigidbody.
Spawnpoint is a rigidbody.

I believe this is the culprit:

Pulsarshoot.rigidbody.AddForce(transform.forward * 50000);

The force is coming from the rigidbody spawnpoint, correct?

It seems you’re using some vector from the original GameObject to apply force to the projectile after launched - if the projectile was launched with only an initial velocity or force, its trajectoy would be independent of the launcher.

But this is only speculation, because you’ve not posted your code. Post the code and we can check what’s wrong.

EDITED: Based on your code, I suppose the real problem is the parenting to the “cueb” object (whatever it is). Since the projectile is a child of this object, any rotation or movement the object does will affect the projectile as well.

The initial force is ok: it should really follow the fire and forget rule, since it’s applied only once - you would have problem only if the force was being applied during the trajectory.

If you need to child the projectile to something for any reason, make sure the parent object will not rotate or move while the projectile is alive. The rule is: child movements do not affect the parent, but parent movement DOES affect the child.