Problem Vector3.transform (C#)

using UnityEngine;
using System.Collections;

public class characterMovement : MonoBehaviour {
	
	// Update is called once per frame
	void Update () {

		if(Input.GetKey(KeyCode.W)){
			transform.position += Vector3.forward * Time.deltaTime;
		}
	}
}

Having a problem with that script and I’m not sure what I’m doing wrong as no errors or console messages are coming back so the script is activated and working but i don’t understand why the functionality isn’t working?

Also, is there any way in which i can link the mouseLook script to the character script? in other words, where the character looks with the mouse, thats what the player will follow? So following head movement?

1st off take a look at the character controller scripts included in the standard assets.

If you want to add backwards movement use -transform.forward instead of transform.forward.

To use the above code put

 Vector3 dir = transform.forward;
        dir.y = 0.0;
        dir.Normalize();
        transform.position += dir * Time.deltaTime;

inside

 if(Input.GetKey(KeyCode.W)){
           
        }

Like so:

 if(Input.GetKey(KeyCode.W)){
        Vector3 dir = transform.forward;
        dir.y = 0.0;
        dir.Normalize();
        transform.position += dir * Time.deltaTime;
            
        }