From bc7ef4bfc2fec5f074003fe113709d2e6ed76c85 Mon Sep 17 00:00:00 2001 From: Jordan Date: Sun, 5 Feb 2023 13:42:31 +1100 Subject: [PATCH] added float parameter option for rowing --- Assets/Scripts/BoatController.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Assets/Scripts/BoatController.cs b/Assets/Scripts/BoatController.cs index 6fe2c01..ed2142e 100644 --- a/Assets/Scripts/BoatController.cs +++ b/Assets/Scripts/BoatController.cs @@ -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);