[英]Unity translate rotate an imported object
我无法在导入的模型上统一translate.rotate (0,5,5)
我应该怎么做才能使其旋转我找不到很好的来源。
我的代码在这里:我将脚本放在齿轮或主摄像头下面,但它不会旋转,我也在脚本上选择了型号名称
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
public GameObject gear;
// Use this for initialization
// Update is called once per frame
void Update () {
gear.transform.Rotate (100, 10, 10);
}
}
根据您的图像,您不会正确执行此操作。 跟着这些步骤 :
Assets
拖放到场景中 NewBehaviourScript
从您的Assets
拖放到Gear Gameobject的检查器中 gear
的的NewBehaviourScript
连接到齿轮游戏对象 如果您认为第4步无用,请按如下所示更改脚本:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
// Update is called once per frame
void Update () {
transform.Rotate (100, 10, 10);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.