transform.translate unity
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#:
- while loop in c#
- C# loop through array of objet
- c# download string url
- how to populate listbox using list<t> c#
- Unity if object doens't exist
- .net core identity get user id
- how to convert iformfile to byte array c#
- c# initialize array
- set decimal point c#
- c# print to console
- linq query select top 1 c#
- pass parameter to thread c#
- how to put double quotes in a string c#
- go to next itiration in foreach C#
- c# join string array
- add object to list c#
- uinput dialog uwp c#
- c# enum.getvalues
- get string character by index c#
- c# string code ascii
- create expression func c# for use in where clause
- remove from list based on condition c#
- c# how to run external program
- eventos c#