I'm working on a 3D game with a spherical collider for the player.
My ground check looks like this, where I'm currently hardcoding
Vector3.down as the direction:
Physics.Raycast(position, Vector3.down, out hit, FLOOR_RAYCAST_DISTANCE, PLAYER_GROUND_COLLISION_MASK)
This works for a majority of cases (as does toying with the value of
FLOOR_RAYCAST_DISTANCE), but breaks down depending on the speed of the character & the intensity of the slope.
My approach is to tilt the raycast direction dynamically based on the velocity of the player, but all my math so far has fallen apart and hasn't worked, as I'm pretty weak with vector rotations. Can anyone help me figure this out?