- Home /
How to make character collide with walls + how to make character stay grounded.
So I know this is gonna seem like a kinda stupid question for most of you but any help is appreciated. So, I have a basic character controller, it moves front/back left/right. It's not able to jump cause that would sorta ruin parts of the game. Here's my problem. 1) When the character walks up a ramp then walks back the way they just came the player doesn't move down along the ground because I don't have a component or script to do that. I want my character to always stay on the ground (btw. the ground is not always level) (btw. I don't want to add gravity to the character cause that gets messy quick) 2) I don't know what components/scripts to add to the ground and the walls to make the character collide with the walls and walk along the floors. I've been using rigid bodies with frozen rotation and position but if 2 of those things are touching and the player runs into it the player will be bounced off and sent rotating through space.
You could try to raycast from the feet of the player to the ground and check the distance. If it is greater than a threshold, the player can "go down a bit". Similarly with the sides of the player. This is quite hacky and resource intensive, as you'd have to raycast a lot.
It is weird that your player bounces off the obstacles. That sounds like your RB has some weird setting. Can you take a screenshot of it / upload your stripped project that i can have a look at?