Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
what do i wrong
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMotor : MonoBehaviour { private CharacterController controller; private Vector3 playerVelocity; public float speed = 5f; // Start is called before the first frame update void Start() { controller = GetComponent<CharacterControler> } // Update is called once per frame void Update() { } //receiv the inputs for our InputManager.cs and apply them to our character controller. public void ProcessMove(Vector2 input) { Vector3 moveDirection = Vector3.zero; moveDirection.x = input.x; moveDirection.z = input.y; controller.Move(transform.TransformDirection(moveDirection) * speed * Time.deltaTime); } }
Show compiler warnings
[
+
]
Show input
fork mode
|
history
|
discussion