Problem with character moving up instead of front

Hi there,

am still starting with unity, am using some tutorials from tornadotwins,

i used their script for walking, however my character instead of moving through the z axis, he moves up through the y axis,

and am sure that the z from both the global and local is pointing to the right direction;

here’s a piece from the code:

var speed = 5.0;
var rotatespeed = 5.0;

function Update()
{
	var controller:CharacterController = GetComponent(CharacterController);
	
	transform.Rotate(0,Input.GetAxis("Horizontal")*rotatespeed,0);
	
	var forward = transform.TransformDirection(Vector3.forward);
	var curspeed = speed*Input.GetAxis("Vertical");
	controller.SimpleMove(forward*curspeed);
}

@script RequireComponent(CharacterController)

Welcome to the Unity Forums! There are a couple good links Unity related in my .sig, including a Custom Search Engine. This is good as it is better than the forum search engine and includes other sites like the Wiki and Unity Answers. There are other links in my signature to find more resources. Drop me a line if you run into trouble, and I’ll try to point you in the correct direction.

Check out this link re: the use of code tags:
http://forum.unity3d.com/threads/134625-Using-code-tags-properly

I have corrected your post with them.

To answer your question: Where did you get your character model from? It may have a different axis as “up”.

thanks mate!,

its actually just a couple of spheres put together but now i notices, that if i removed the eyes, its all good, the character moves normally, so it must be something which has to do with axis of the eyes like you said,

another thing, maybe you know,

i downloaded some free models, however when i put them into my project, they fall down, even though the ground is set to 0,0,0 and i tried to set it to convex but to no avail,

maybe you know why?

Do they have a collider at all? Could be that you have a rigidbody and no collider to stop it? Check for a collider, and if there is non, add one… For Humanoid characters, I’d suggest the Capsule Collider:

If you are just getting started, do look thru the teaching section and don’t forget to check out the Online Training we provide:

i did not try that, i will and report back here, thanks a lot!