How would I create a prefab that moves forward?

Hey guys, I’m new to unity, and was wondering how I would apply a force along a local vector, in other words shoot a projectile in the direction my character is facing.

I attached a script that creates an object according to the prefab assigned to my character, and I’ve attached a script that applies a force each frame along a global vector to the prefab but I want it to be local… Help? :slight_smile:

If all you want to do is find the facing vector of your character, use its transform.forward. To transform arbitrary vectors between local and world space, use TransformDirection.

Well, I figured it out, but I don’t know how to close the thread… Here’s my code :smiley:

var speed : float = 1.0;
var character : GameObject;

function Update () {

	transform.Translate(Vector3(0,0,speed) * Time.deltaTime);


I needed to translate it, instead of applying a force to it, why this works, I honestly do not know, but it does so :smiley: