3dBuzz tutorial problems

Hey all. I’ve been working with 3dbuzz.com tutorials to learn unity. After I finished going through the basics and decided I would go ahead and go through with the Third Person tutorials. After getting through the implementation of the TP_Controller and TP_Motor I’ve come across a snag. The character is supposed to move towards in the direction that the camera is looking. And for the most part that works fine, the player moves side the side, forwards and backwards and turns in the direction of the camera. The only problem is that when I move forward the player moves very slowly.

I have a programming background, but 3d programming is still very new to me. I just can’t figure out whats going on with this code. lol

TP_Motor.cs

using UnityEngine;
using System.Collections;

public class TP_Motor: MonoBehaviour{
	public static TP_Motor Instance;
	public float MoveSpeed = 10.0f;
	public Vector3 MoveVector { get; set; }

	void Awake(){
		Instance = this;
	}
	
	public void UpdateMotor(){
		SnapAlignCharacterWithCam();	
		ProcessMotion();
			
	}
	
	void ProcessMotion(){
		// Transform MoveVector to World Space
		MoveVector = transform.TransformDirection( MoveVector );
		
		// Normalize MoveVector if Magnitude > 1
		if( MoveVector.magnitude > 1 )
			MoveVector = Vector3.Normalize( MoveVector );
		
		// Multiply MoveVector by MoveSpeed
		MoveVector *= MoveSpeed;
		
		// Multiply MoveVector by DeltaTime
		MoveVector *=  Time.deltaTime;
		
		// Move the Actor in World Space
		TP_Controller.TPController.Move( MoveVector );
	}
	
	void SnapAlignCharacterWithCam(){
		if( MoveVector.x != 0 || MoveVector.z != 0 ){
			transform.rotation = Quaternion.Euler( transform.eulerAngles.x, Camera.mainCamera.transform.eulerAngles.y, transform.eulerAngles.z );
		}
	}
}

TP_Controller.cs

using UnityEngine;
using System.Collections;

public class TP_Controller: MonoBehaviour{

	public static CharacterController TPController;
	public static TP_Controller Instance;

	void Awake(){
		TPController = GetComponent( "CharacterController" ) as CharacterController;
		Instance = this;
	}
	
	// Update is called once per frame
	void Update(){
		if ( Camera.mainCamera == null )
			return;
			
		GetLocomotionInput();
		
		TP_Motor.Instance.UpdateMotor();
	}
	
	void GetLocomotionInput(){
		var deadZone = 0.1f;
		
		TP_Motor.Instance.MoveVector = Vector3.zero;
		
		if( Input.GetAxis( "Vertical" ) > deadZone || Input.GetAxis( "Vertical" ) < -deadZone ){
			TP_Motor.Instance.MoveVector += new Vector3( 0, 0, Input.GetAxis( "Vertical" ) );
		}
		if( Input.GetAxis( "Horizontal" ) > deadZone || Input.GetAxis( "Horizontal" ) < -deadZone ){
			TP_Motor.Instance.MoveVector += new Vector3( Input.GetAxis( "Horizontal" ), 0, 0 );
		}
	}
}

Do you also have a collider on the player object ?

Hmm… Yeah, the Character Controllers collider. The only components attached to the Player object are the Capsule( Mesh Filter ), Mesh Renderer, Character Controller, and the two scripts above. Also… after some testing I’ve come to the conclusion that maybe the Player object these scripts are attached to are receiving the x rotation of the camera as well as the y rotation of the camera because when I move the camera to nearly top down and test the scene the player doesn’t move yet the more I rotate the camera viewport parallel to the ground the faster the player goes. The code looks right and, from my understanding, isn’t even touching the cameras x rotation. It’s like the Player is trying to move in the full direction the camera is facing, instead of just it’s y rotation direction and the floor is slowing it down.