i can't translate.rotate (0,5,5)
in unity on an imported model
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);
}
}
答案 0 :(得分:2)
According to your image, you don't do it corretly. Follow these steps :
Assets
and drop it into your sceneNewBehaviourScript
from your Assets
and drop it to the inspector of the Gear Gameobjectgear
of the NewBehaviourScript
attached to the gear gameobjectIf you feel the 4th step is useless change the script as follow :
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);
}
}