-2
こんにちは皆さん、私は私の宇宙船の回転にいくつか問題があります。左の矢印を押して右の矢印に切り替えると、回転が即座に切り替わります。どのように私はそれをスムーズにすることができますか?unity3d spaceshooter movement
ビデオ: https://sendvid.com/fek9izy3
void FixedUpdate()
{
Rigidbody rb = GetComponent<Rigidbody>();
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
rb.velocity = movement * speed;
rb.position = new Vector3
(
Mathf.Clamp(rb.position.x, boundary.xMin, boundary.xMax),
0.0f,
Mathf.Clamp(rb.position.z, boundary.zMin, boundary.zMax)
);
rb.rotation = Quaternion.Euler(0.0f, 180, rb.velocity.x * -tilt);
}
}