force too -z ax

Hey guys, basicly im making a space ship game, and was wondering if you new a script so when I pushed the up arrow, it pushes it along the -z axis, as if the engine was pushing it.

Thanks again! :slight_smile:

(Iā€™m a C# user, so implement the idea according to what you write in)

using UnityEngine;
using System.Collections;

public class Move : MonoBehaviour 
    public float engineThrust = 5.0f;
    void Update() 
         var z = Input.GetAxis("Vertical") * Time.deltaTime * engineThrust;
         transform.translate (0,0,z);