您的位置:首页 > 移动开发 > Unity3D

unity基础开发----物体位移和旋转实用代码

2013-11-21 22:46 531 查看
using UnityEngine;
using System.Collections;

public class text : MonoBehaviour {

    public GameObject MoveGameObject;
   // public Vector3 Terget;
    public Transform Terget;
    public float speed=10;
	// Use this for initialization
	void Start () {
        
	}
	
	// Update is called once per frame
	void Update () {
	
      // MoveGameObject.transform.position=Vector3.MoveTowards(transform.position,Terget,0.005f);
        MoveGameObject.transform.rotation = Quaternion.RotateTowards(transform.rotation, Terget.rotation,Time.deltaTime*speed);
	}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: