09.06.2017 22:37
Если ещё актуально то будет выглядеть примерно так:
public float speed;
private Rigidbody rb;
public GameObject Player;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void Update()
{
if (Input.GetKey(KeyCode.W))
{
rb.drag = 0;
Player.GetComponent<Rigidbody>().AddForce(Player.transform.forward * speed);
}
else
{
rb.drag = 20;
}
}