transform.translate unity
C#
public Transform tr; //make reference in Unity Inspector
public float SpdX = 1f;
public float SpdY = 0f;
private void Update()
{
tr.Translate(new Vector2(SpdY, SpdX)); //no its not a typo, first goes Y then X. IDK Why
} //you use Vector3 if you use 3dtransform.Translate(Vector3.up * Time.deltaTime, Space.World);using UnityEngine;
using System.Collections;public class ExampleClass : MonoBehaviour
{
void Update()
{
// Move the object forward along its z axis 1 unit/second.
transform.Translate(Vector3.forward * Time.deltaTime); // Move the object upward in world space 1 unit/second.
transform.Translate(Vector3.up * Time.deltaTime, Space.World);
}
}
Also in C#:
- Title
- c# catch two exceptions in one block
- Category
- C#
- Title
- unity vector3 smoothdamp not reaching target
- Category
- C#
- Title
- check if number is even or odd c#
- Category
- C#
- Title
- c# make http request
- Category
- C#
- Title
- how to reference the position of a game object unity
- Category
- C#
- Title
- json serialize object capitalization config
- Category
- C#
- Title
- unity how to see what scen you are in
- Category
- C#
- Title
- C# check if is first run
- Category
- C#
- Title
- c#if
- Category
- C#
- Title
- loop through string array c#
- Category
- C#
- Title
- decalre an int list mvc
- Category
- C#
- Title
- wpf datatrigger enum binding
- Category
- C#
- Title
- stateteach.net
- Category
- C#
- Title
- bundle.config in mvc is missing
- Category
- C#
- Title
- unity 2d detect click on sprite
- Category
- C#
- Title
- asp.net get query string parameter
- Category
- C#
- Title
- how to set a gizmo color unity
- Category
- C#
- Title
- unity how to rotate something to point to something else
- Category
- C#
- Title
- collision detector unity c# 2d
- Category
- C#
- Title
- C# previous method
- Category
- C#
- Title
- unity main texture not working
- Category
- C#
- Title
- run async methods within a sync process
- Category
- C#
- Title
- how to create more accurate searching c#
- Category
- C#
- Title
- c# check file exists
- Category
- C#
- Title
- unity ui change sprite
- Category
- C#
- Title
- how to make infinite loop in c#
- Category
- C#
- Title
- what does gameobject.find return
- Category
- C#
- Title
- open udp socket c#
- Category
- C#
- Title
- gfortran: declare an array
- Category
- C#
- Title
- copy a list C#
- Category
- C#
- Title
- how to disable a gameObject unity c#
- Category
- C#
- Title
- unity how to change rotation
- Category
- C#
- Title
- c# cheat sheet
- Category
- C#
- Title
- c# round to closest multiple
- Category
- C#
- Title
- split string in c#
- Category
- C#
- Title
- c# list string return concatenate
- Category
- C#
- Title
- how to pass object as test case in nunit c#
- Category
- C#
- Title
- c# creating exceptions
- Category
- C#
- Title
- how to destroy a gameobject after some hits in unity 3d
- Category
- C#
- Title
- variables
- Category
- C#
- Title
- c# fold list
- Category
- C#
- Title
- httpclient soap request c#
- Category
- C#
- Title
- how to get component in unity c#
- Category
- C#
- Title
- https request c#
- Category
- C#
- Title
- c# how to run external program with args
- Category
- C#
- Title
- how to reload app.config file at runtime in c#
- Category
- C#
- Title
- creating a c# class
- Category
- C#
- Title
- c# string array to string
- Category
- C#
- Title
- dont destroy on load unity
- Category
- C#
- Title
- how to get value from object in c#
- Category
- C#
- Title
- unity3d debug pause
- Category
- C#
- Title
- c# check if argument null
- Category
- C#
- Title
- unity making homing rocket
- Category
- C#
- Title
- dynamic group by expression C#
- Category
- C#
- Title
- unity invoke
- Category
- C#
- Title
- unity rotate around point
- Category
- C#
- Title
- how to generate random unique id in c#
- Category
- C#
- Title
- set current date to textbox in asp.net
- Category
- C#
- Title
- c# linq to get most recent item from IList
- Category
- C#
- Title
- c# write variable in string
- Category
- C#
- Title
- how to make a datatable in c#
- Category
- C#
- Title
- unity how to change max fps
- Category
- C#
- Title
- reload current scene unity
- Category
- C#
- Title
- c# function return
- Category
- C#
- Title
- c# print to console
- Category
- C#
- Title
- c# loop string array
- Category
- C#
- Title
- count the number of notes in a given amount c#
- Category
- C#
- Title
- c# regex to find number between parenthesis
- Category
- C#
- Title
- math class C# exponents
- Category
- C#
- Title
- c# how to open file explorer
- Category
- C#
- Title
- asp multi select dropdown
- Category
- C#
- Title
- c# windows forms draw pixel
- Category
- C#
- Title
- c# new list object
- Category
- C#
- Title
- same click event diffrenet buttonms c#
- Category
- C#
- Title
- dto and automapper
- Category
- C#
- Title
- unity change text color
- Category
- C#
- Title
- c# bitmap to Image
- Category
- C#
- Title
- weakreference tryget c#
- Category
- C#
- Title
- c# convert to int
- Category
- C#
- Title
- c# arrays of arrays
- Category
- C#
- Title
- how to use variables in c#
- Category
- C#
- Title
- c# how to refresh your binding source
- Category
- C#
- Title
- unity make a int arry with preset values
- Category
- C#
- Title
- c# keyboard enter
- Category
- C#
- Title
- disable a component unity
- Category
- C#
- Title
- ASP select box all states
- Category
- C#
- Title
- lazy loading c#
- Category
- C#
- Title
- c# yield
- Category
- C#
- Title
- c# checksum
- Category
- C#
- Title
- c# array Reverse method
- Category
- C#
- Title
- unity how to check object position
- Category
- C#
- Title
- c# datetime dd/mm/yyy hh:mm:ss
- Category
- C#
- Title
- list contains type c#
- Category
- C#
- Title
- c# array to list
- Category
- C#
- Title
- how get data from json in c#
- Category
- C#
- Title
- xamarin forms alarm
- Category
- C#
- Title
- unity rigidbody constraints
- Category
- C#
- Title
- docker ssh
- Category
- C#
- Title
- c# class to byte array
- Category
- C#
- Title
- file picker uwp c#
- Category
- C#