It is really cool how unity automatically stops a character if the slope is too steep.
However I would like the character to slide back down if he gets to that point, so is there a function i can call which says if this is true/false?
It is really cool how unity automatically stops a character if the slope is too steep.
However I would like the character to slide back down if he gets to that point, so is there a function i can call which says if this is true/false?
How would a character ‘slide back down’ a slope he wasn’t able to climb up in the first place?
like the area will be be hill based, so unless the angle is 90 degrees it would of gone part of the way up the hill.
Oh, you mean if the player is walking on a slope that gradually increases gradient until it’s too steep to climb further? And then you want the player to slide back down until the gradient is shallower than some other angle (less than the CharacterController slope limit)? The CharacterController component isn’t that sophisticated, I’m afraid. You’d have to create your own logic for ‘if character is standing on a slope, and slope angle > X, move ‘downhill’ until slope angle is less than X’.
That would involve querying the terrain to determine the angle of slope beneath the character, working out what direction the character should slide if the angle is too steep (and at what speed), then calling CharacterController’s Move() or SimpleMove() to actually effect the movement.