我最近开始搞乱Unity 5 Scripting API,我似乎无法让这段代码适用于我的Simple Smiley Face Sprite1。我希望它做的只是轻微移动。我尝试了多种解决方案。我相信它不接受键盘按钮,或者它没有找到精灵。预先感谢您的帮助!雪碧移动在Unity 5
...超简单的代码,我只是在试验。
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start() {
}
// Update is called once per frame
void Update() {
if (Input.GetKey ("q")) {
var Sprite1 = GameObject.Find("Sprite1");
Sprite1.transform.Translate(1,3,5);
}
}
}
10号或任何其他的速度到底是什么不工作?你在调试时看到了什么?有没有错误信息?这不足以帮助你。 – displayname