move gameobject to position unity
public Transform target; public float speed; void Update() { float step = speed * Time.deltaTime; transform.position = Vector3.MoveTowards(transform.position, target.position, step); }
move gameobject to position unity
public Transform target; public float speed; void Update() { float step = speed * Time.deltaTime; transform.position = Vector3.MoveTowards(transform.position, target.position, step); }
how to move a gameobject
public static int movespeed = 3; public Vector3 userDirection = Vector3.down; //You can change this to any direction void Update() { transform.Translate(userDirection * movespeed * Time.deltaTime); }
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us