Hello good people of Unity,
I currently work on a snowboard game as a student project. I am not quite sure about the arcade/simulation ratio. Because of that and because I always want to learn more about physics I want to make it physically as accurate as possible. I like the idea to simply work with gravitational potential, kinetic energy and (dynamic) friction using a Rigidbody component and Physics Materials.
What I have so far is a snowboard with a Rigidbody component, reasonable physical properties and a custom script for adding natural and player control forces. With tweaked friction values my snowboard nicely slides down a slope, picks up and loses speed with respect to the gradient.
But unlike a snowboard or a sledge the friction acts in all directions/axes equally and my snowboard takes turns down the slope along the path with least resistance. That is to say it of course doesn’t respect the orientation of my “mesh” - how could it? I mean it respects the shape of the simplified box collider but that collider has equal friction on all sides and surfaces.
Assume the following values for a common understanding:
-
let angle A be the horizontal deviation angle from perfectly downhill
-
A = 0° represents the snowboard pointing perfectly downhill
-
A = 90° represents the snowboard being perpendicular to gravity (absolute value not considering left or right orientation)
In a perfect world without friction along the longitudinal axis and without other application of force the snowboard would rest at A = 90° but move at any value less than 90°. It would only move slower or faster depending on the angle. Due to friction along the transversal/lateral axis the snowboard will basically hold its line until stopped by another force. If you let the snowboard slide down with an angle A = 45° it would keep that angle. More than say 95% of the steering of a snowboard will happen by application of outside forces (i.e. the snowboarder exerting torque forces).
I am yet to find an approach to realize this in Unity. My idea was to add gravitational acceleration myself and account for slope, snowboard orientation and friction with respect to orientation.
As a further information I would like to control the snowboard via real forces and e.g. the AddForceAtPosition() method to add torque around the snowboard’s center of mass and use that for steering, braking, carving, skidding.
Does anyone know how I would approach the matter? I would be glad for any input or clues.
Thank you in advance