嘿家伙我是新来的编码,我正在努力工作这个简单的代码我需要此代码连续循环运行5秒,而不会将其更新。虽然循环不工作代码不runnign 60帧
void Update() {
}
void OnTriggerEnter2D(Collider2D other)
{
timer += Time.deltaTime;
if (other.gameObject.CompareTag("IcePickup"))
{
Destroy(other.gameObject);
Blade1 = GameObject.Find("Blade1");
Blade1.gameObject.GetComponent<SpriteRenderer>().sprite = IceBlade;
int counting = 1;
while (counting <= 10)
{
print("icey");
(Blade1.transform.Rotate(new Vector3(0, 0, -0.50f));
counting ++;
}
}
}
Blade1.transform.Rotate(new Vector3(0,0,-0.50f)); woops那里应该没有支架... –
所以刀片正在旋转的另一个脚本它会去0,0,-3.00f但是当我得到冰皮卡我试图改变速度到-0.50f,但我不能解决它。 –
编辑您的问题并通过更多信息进行更新 – Veltas