using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Teratail : MonoBehaviour { public Slider sliderL; void Update() { //sliderL.valueの値に応じて傾斜角度を変更(一番目のプログラム) float speed = 5.0f; float step = speed * Time.deltaTime; transform.rotation = Quaternion.RotateTowards(transform.rotation, Quaternion.Euler(-5.0f * sliderL.value, 0, 0), step); //旋回(二番目のプログラム) float rot = 0.0f; if (Input.GetKey("d")) { rot = 0.05f; } if (Input.GetKey("a")) { rot = -0.05f; } transform.Rotate(0.0f, rot, 0.0f); } }
このプログラムの
transform.Rotate(0f, rot, 0f);
が機能しません。どうすれば機能しますか?
よろしくお願いいたします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/03/30 08:54
2022/03/31 07:42 編集