nish
6
Q:

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(SpdX, SpdY));
}				//you use Vector3 if you use 3d
4
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);
    }
}
0
transform.Translate(Vector3.up * Time.deltaTime, Space.World);
0

New to Communities?

Join the community