Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity move character

using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
    [SerializeField] private float speed = 5.0f;

    private void Update()
    {
       var horizontal = Input.GetAxis("Horizontal");
       var vertical = Input.GetAxis("Vertical");
       transform.Translate(horizontal * (speed * Time.deltaTime), 0, vertical* (speed * Time.deltaTime));
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: set active text unity 
Csharp :: on collision 2d unity 
Csharp :: loadscene unity 
Csharp :: random.range unity 
Csharp :: c# copy list without reference 
Csharp :: what is the namespace for textmesh pro 
Csharp :: c# string to char 
Csharp :: set ads for children admob unity 
Csharp :: how to store more precise data then double c# 
Csharp :: how check if variable is send to page or not in laravwel 
Csharp :: vs code explorer font size 
Csharp :: unity detect if version is a build or in editor 
Csharp :: how to log out of unity asset store 
Csharp :: c# check if string is directory 
Csharp :: how to set progress openedge driver name for odbc connection c# 
Csharp :: check if network is available c# 
Csharp :: unity how to reorder a list 
Csharp :: stopwatch c# 
Csharp :: c# array remove first element 
Csharp :: unity animator current state name 
Csharp :: c# writteline 
Csharp :: C# check if is first run 
Csharp :: convert dto to dictionary c# 
Csharp :: change textbox text color c# 
Csharp :: c# @ before string 
Csharp :: C# datetime.now to string only numbers 
Csharp :: c# getforegroundwindow 
Csharp :: blazor oninitializedasync 
Csharp :: start the terminal from c# 
Csharp :: tooltips unity 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =