като се движи към единство на обекта
//This will work for 2d or 3d platforms
//Make sure to call in Update or else it wont work
Vector3.MoveTowards(transform.position, taretPos, Qiaternion.identiy)
как да се движат игри обект в друг обект
//Attach this to the oject you want to move
public GameObject Bullet
public GameObject Cannon
void Start()
{
(Bullet) = GameObject.Find("Bullet"); //These are to find the object to move to
(Cannon) = GameObject.Find("Cannon");
Bullet.transform.position = Cannon.transform.position; //this is to move the object
}
горещо, за да се движат pobject unity
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);
}
}