07-25-2023, 10:33 PM
Hi
I modified the class to implement a simple slope induced speed:
I hope this helped
Have a nice day
I modified the class to implement a simple slope induced speed:
Code:
public class E10_MotorController : SplineController
{
[Section("Motor")]
public float MaxSpeed = 30;
public float SlopeFactor = 10;
protected override void Update()
{
float axis = Input.GetAxis("Vertical");
float slopeInducedSpeed = Mathf.Abs(GetTangent(RelativePosition).y) * SlopeFactor;
Speed = Mathf.Abs(axis) * MaxSpeed + slopeInducedSpeed;
MovementDirection = MovementDirectionMethods.FromInt((int)Mathf.Sign(axis));
base.Update();
}
}I hope this helped
Have a nice day
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Please consider leaving a review for Curvy, this helps immensely. Thank you.

