using UnityEngine; using System.Collections; public class Test : MonoBehaviour { public GameObject someObject; public void Awake() { //在当前对象(transform)的右边实例化一个物体(someObject) Vector3 thePosition = transform.TransformPoint(Vector3.right * 2);//返回世界坐标 Instantiate(someObject, thePosition, someObject.transform.rotation); } }