[英]Unity translate rotate an imported object
i can't translate.rotate (0,5,5)
in unity on an imported model 我无法在导入的模型上统一
translate.rotate (0,5,5)
what should i do to make it rotate i can't find a good source. 我应该怎么做才能使其旋转我找不到很好的来源。
my code is here: i put script under gear or main camera but it doesn't rotate i also selected model name on script 我的代码在这里:我将脚本放在齿轮或主摄像头下面,但它不会旋转,我也在脚本上选择了型号名称
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);
}
}
According to your image, you don't do it corretly. 根据您的图像,您不会正确执行此操作。 Follow these steps :
跟着这些步骤 :
Assets
and drop it into your scene Assets
拖放到场景中 NewBehaviourScript
from your Assets
and drop it to the inspector of the Gear Gameobject NewBehaviourScript
从您的Assets
拖放到Gear Gameobject的检查器中 gear
of the NewBehaviourScript
attached to the gear gameobject gear
的的NewBehaviourScript
连接到齿轮游戏对象 If you feel the 4th step is useless change the script as follow : 如果您认为第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.