Moving an Object(Bullets) towards a Vector position and beyond

Hello everyone,

amateur dev here working on a multiplayer mobile game, in my project I have a shooting mechanic via touch on mobile, how we implemented it is we are on a 3D scene with an isometric-like camera and every time we touch the screen a raycast hits the ground which is a collection of many mini plane objects and through that we get the position of the ground that we touch in a Vector3 ( any ideas of an alternate way are greatly appreciated ).

Right now we have working code for everything but we have one issue.

We are using MoveTowards like so

void Update () {
	transform.position = Vector3.MoveTowards(transform.position,myTarget,Time.deltaTime*speed);
	}

where myTarget is our Vector3 variable.

We are looking for a way to move towards that position and way beyond it (shooting bullets towards the touch position and the bullet flying through the touch position afterwards)

Any ideas will be of great help!

Thank you

When you hit fire, get the vector for the direction you want to move in by subtracting starting position from target position and normalize it. So that would look something like this:

private Vector3 moveDir;

void Fire()
{
	Vector3 moveDir = (myTarget - transform.position).normalized;
}

Then in Update, move your bullet in that direction from it’s current position like this:

void Update()
{
	transform.position += moveDir * speed * Time.deltaTime; 
}

conman79’s is good, but to kill two birds with one stone because why not:
using Unity - Scripting API: Transform.LookAt
and Unity - Scripting API: Transform.Translate

void Start () {

this.transform.LookAt(Target.transform.position);

}

void Update () {

this.transform.Translate (0, Speed, 0, Space.Self); //Space.Self is important, always goes
                                                    //Regardless of Rotation

}

Anyone got a clue ? : )