transform.rotate 不工作
transform.rotate not working
我正在尝试制作一个简单的 2d space 射击游戏。我创建了一颗小行星并想让它旋转。所以我在上面附加了一个脚本并将其作为这个(见下文)但图像没有旋转。
using UnityEngine;
using System.Collections;
public class Rotator : MonoBehaviour {
void update () {
transform.Rotate (0, 90 * Time.deltaTime, 0);
}
}
将"update()"更改为"Update()"
如果该代码是复制粘贴的,那么显然就是问题所在。
我正在尝试制作一个简单的 2d space 射击游戏。我创建了一颗小行星并想让它旋转。所以我在上面附加了一个脚本并将其作为这个(见下文)但图像没有旋转。
using UnityEngine;
using System.Collections;
public class Rotator : MonoBehaviour {
void update () {
transform.Rotate (0, 90 * Time.deltaTime, 0);
}
}
将"update()"更改为"Update()"
如果该代码是复制粘贴的,那么显然就是问题所在。