Desmos is an incredibly useful tool.
I wanted to be able to have my player controller have one physics material with friction and bounce coefficients for the ground and another for walls and slopes.
https://www.desmos.com/calculator/fojf01ikf4
#gamedev #math #trigonometry
I wanted to be able to have my player controller have one physics material with friction and bounce coefficients for the ground and another for walls and slopes.
https://www.desmos.com/calculator/fojf01ikf4
#gamedev #math #trigonometry
Comments
The red circle's friction is set to tan(theta), so the player will slide on angles above theta, but not below.
I store theta and other character controller settings in a scriptable object, so settings can be swapped for different kinds of characters.
Funnily enough this wasn't a solved problem online so I had to derive it myself! Gamedev challenges!