Advertisement
Guest User

Código Javascript Personaje

a guest
Apr 23rd, 2014
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. var sp : float = 5.0; var grav : float = 18.0; private var direction : Vector3 = Vector3.zero; function Update() { var contr : CharacterController = GetComponent(CharacterController); if (contr.isGrounded) { direction = Vector3 (Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")); direction = transform.TransformDirection(direction); direction *= sp; } direction.y -= gravity * Time.deltaTime; contr.Move(direction * Time.deltaTime); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement