In this tutorial you will learn the basic movement of a gameobject.
Watch in HD! For better quality!
Script:
var speed = 3.0;
var rotateSpeed = 3.0;
function Update ()
{
var controller : CharacterController = GetComponent(CharacterController);
// Rotate around y - axis
transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
// Move forward / backward
var forward = transform.TransformDirection(Vector3.forward);
var curSpeed = speed * Input.GetAxis ("Vertical");
controller.SimpleMove(forward * curSpeed);
}
@script RequireComponent(CharacterController)
Sorry for Bad Quality :(
On this page of the site you can watch the video online Unity3D Tutorial 01# - Basic Movement with a duration of hours minute second in good quality, which was uploaded by the user MacedonianProduction 26 May 2011, share the link with friends and acquaintances, this video has already been watched 4,104 times on youtube and it was liked by 10 viewers. Enjoy your viewing!