Browse Source

added float parameter option for rowing

main
Jordan 1 year ago
parent
commit
bc7ef4bfc2
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      Assets/Scripts/BoatController.cs

+ 12
- 0
Assets/Scripts/BoatController.cs View File

@ -62,12 +62,24 @@ public class BoatController : MonoBehaviour
rigidBody.AddTorque(transform.up * -RotationFactor);
}
public void RowLeft(float velocity)
{
rigidBody.AddForce(transform.forward * ForwardFactor * velocity, ForceMode.Acceleration);
rigidBody.AddTorque(transform.up * -RotationFactor * velocity);
}
public void RowRight()
{
rigidBody.AddForce(transform.forward * ForwardFactor, ForceMode.Acceleration);
rigidBody.AddTorque(transform.up * RotationFactor);
}
public void RowRight(float velocity)
{
rigidBody.AddForce(transform.forward * ForwardFactor * velocity, ForceMode.Acceleration);
rigidBody.AddTorque(transform.up * -RotationFactor * velocity);
}
public void Brake()
{
rigidBody.AddForce(rigidBody.velocity * - BrakeFactor);

Loading…
Cancel
Save