AddForce mechanism ?

public GameObject target;

GameObject Bullet = Instantiate(bullet, transform.position, Quaternion.identity) as GameObject;
Bullet.transform.localRotation = Quaternion.Euler(90f, 0f, 0f);
Bullet.GetComponent().AddForce(target.transform* speed);

I have a script like this. and before start, I added a target object that is in hierarchy to script.

I wanted to make my bullets are fired at position of ‘target’ (go ahead to target)
but when I start to make bullets, bullets are fired at same direction.
and the direction is not even close to target.
(bullets go to floor, the theta of direction vector of bullets and floor may be 45… or 30…)

Bullet.GetComponent().AddForce(target.transform.forward* speed);

When I change my code like this, still bullets fire at same direction. but direction is much closer to target than before. (make better result)

So these are my question.

  1. Why tartget.transform.forward make better result? what is difference between target.transform.position and target.transform.forward?
  2. I want to know mechanism of AddForce. How to give force to bullet? I studied calculus in university and I know some vector stuffs and Physics things. (but not very far)
  3. How to make bullets fly to target? I want to shoot bullets to target wherever player is.

sorry for my bad English. thank you for reading

You should try the Transform.LookAt() method, I was once also stuck here. The following link has more information:

This code might help in the Start() method:

void Start() {
     // target refers to the player: store the player in a Transform variable
     transform.LookAt(target)
     transform.LookAt(target, Vector3.left)
}

Tell me if this helps.