Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Unity Character Controller Version 2
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { CharacterController characterController; public float speed = 6.0f; public float jumpSpeed = 8.0f; public float gravity = 20.0f; private Vector3 moveDirection = Vector3.zero; void Start() { characterController = GetComponent<CharacterController>(); } void Update() { if (characterController.isGrounded) { moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0.0f, Input.GetAxis("Vertical")); moveDirection *= speed; if (Input.GetButton("Jump")) { moveDirection.y = jumpSpeed; } } moveDirection.y -= gravity * Time.deltaTime; characterController.Move(moveDirection * Time.deltaTime); } }
run
|
edit
|
history
|
help
0
assignment no.3.cs
reverseandcheck
towers of hanoi
Length
ffsfsfsfsfsferwfehtyjrvgjb
Encrption & Decryption C#
Jjjj
generics one more doubt-stack overflow exception
Math 9.7 (Added Speed Math)
4/03/2017