私はUnityとC#の方が新しく、これを理解するのに苦労しています!ユニティアクセラレーションと減速C#
私は船が徐々にスピードを上げてゆき、ゆっくりと停止して宇宙のゲームになるような重力がないかのようにしたいです!
誰かが私を助けたり、この主題のチュートリアルに私を導いてくれたら、私は感謝します! :)は
ここに私の宇宙船のための私のコードは、現在...
using UnityEngine;
using System.Collections;
using UnityStandardAssets.CrossPlatformInput;
public class PlayerMovement : MonoBehaviour {
public float maxSpeed = 6f;
public float rotSpeed = 180f;
void Start()
{
}
void Update() {
Quaternion rot = transform.rotation;
float z = rot.eulerAngles.z;
z -= CrossPlatformInputManager.GetAxis ("Horizontal") * rotSpeed * Time.deltaTime;
rot = Quaternion.Euler (0, 0, z);
transform.rotation = rot;
Vector3 pos = transform.position;
Vector3 velocity = new Vector3 (0, CrossPlatformInputManager.GetAxis("Vertical") * maxSpeed * Time.deltaTime, 0);
pos += rot * velocity;
transform.position = pos;
}
}
はどのようにこれを行うことができますか?
"easeInOutCubic"のようなものを作りたいですか? (CSSから取った) – Radinator
[this](http://answers.unity3d.com/questions/514505/acceleration-script.html)は、物理エンジンを使用せずに、あなたが望むものを達成するのに役立つかもしれません。あなたの場合は私が推測する)。 – Kardux