Hey I am trying for slowing my player down this is the code I’m useing:
Rigidbody2D rb2d;
void FixedUpdate () {
rb2d = GetComponent<Rigidbody2D>();
if (Input.GetKey(KeyCode.W)) {
this.rb2d.AddForce(transform.up * _speed / 2);
}
if (Input.GetKey(KeyCode.A)) {
transform.Rotate(Vector3.forward * 0.75f * _speed);
}
if (Input.GetKey(KeyCode.D)) {
transform.Rotate(Vector3.forward * -0.75f * _speed);
}
if () {
Debug.Log("DownKey");
}
this.rb2d.velocity = this.rb2d.velocity * 0.9;
}
I get the error: error CS0019: Operator '*' cannot be applied to operands of type 'UnityEngine.Vector2' and 'double'