public override void FixedUpdate() { if (IsPropeling && chargeLeft > 0) { OwnBody.AddForce(Vector3.up * power); chargeLeft -= Time.fixedDeltaTime; } }
void ProcessInput() { Vector3 force = Vector3.ProjectOnPlane(new Vector3(input.h, 0, input.v), Ground.Normal); force.Normalize(); force *= power * input.speedRatio; Vector3 position = Parent.position + Parent.forward * 2; OwnBody.AddForceAtPosition(force, position); }