Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to do that a objetct moves in c#

using System.Collections;  
using System.Collections.Generic;  
using UnityEngine;  
  
public class move : MonoBehaviour {  
  
    // Use this for initialization  
    void Start () {  
          
    }  
      
    // Update is called once per frame  
    void Update () {  
        if (Input.GetKey (KeyCode.W)) {  
            transform.Translate (0.05f, 0f, 0f);      
        }  
        if (Input.GetKey (KeyCode.S)) {  
            transform.Translate (-0.05f, 0f, 0f);      
        }  
        if (Input.GetKey (KeyCode.D)) {  
            transform.Translate (0.0f, 0f, -0.05f);      
        }  
        if (Input.GetKey (KeyCode.A)) {  
            transform.Translate (0.0f, 0f, 0.05f);      
        }  
    }  
  
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: unique field in class model .net core 
Csharp :: update browserslist 
Csharp :: monogame delta 
Csharp :: c# merge two lists as queryable 
Csharp :: how to make 3d field of view in unity 
Csharp :: null-conditional operators c# 
Csharp :: automapper c# initialize error 
Csharp :: c# picturebox cursor hand 
Csharp :: how to make randomizer c# 
Csharp :: how to check url has parameter in c# 
Csharp :: global variables unity 
Csharp :: Comparing Arrays using LINQ in C# 
Csharp :: pick random point inside box collider unity 
Csharp :: demand a Security action c# 
Csharp :: unity find all scriptable objects of a type 
Csharp :: .net mvc foreach index 
Csharp :: Reading emails from Gmail in C# 
Csharp :: begininvoke async c# 
Csharp :: cursor position c# 
Csharp :: how to count letters in c# 
Csharp :: how prevent user remove file linux 
Csharp :: c# property attribute 
Csharp :: select from list where not in other list c# 
Csharp :: Generic Stack in c# 
Csharp :: list cast< c# 
Csharp :: c# comments 
Csharp :: list view in unity 
Csharp :: user input to array object c# 
Csharp :: c# webclient vs httpclient 
Csharp :: How to find column name with column index in DataGridView 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =