Currently in ammo when a capsule collision entity stands on a edge it falls off automatically when half of its diameter leaves the edge. I want to make it so the capsule only falls when its entire diameter leaves the edge. Is this possible to achieve without a raycast? Maybe setting some sort of a box collision entity or something underneath the player? But I can’t figure out the logic. I would appreciate any guidance
That’s is the solution that I also use in my game, but I don’t use physics in my game. Using a raycast does not block the gravity and if you make a 3D game where the player can rotate 360 degrees a single raycast will not be enough.
If I have some time I can try to make an example project with one of the solutions from the other topic.
Yep in a 3D game especially, the player base is going to require many raycasts to check the circumference of the player. I was thinking there could be a more easier way (like simulating a certain shape underneath the player - like in the example I linked) or extending the capsule’s collision diameter.
I would appreciate that. If I can understand the logic of how to achieve this I will give it a shot at implementing too.
I think the solution of @Leonidas in the post below is really easy to implement. What are the current settings of your rigidbody component and how do you move your player? Can you show this or can you share a link to your project?
Sorry for being confusing, i may have explained the problem wrong.
Basically when you change the players collision to a box or cylinder it does what i want (the player can still stand on the edge of a platform without sliding off/falling). However when the players collision is a capsule it slides off/falls as soon as the bottom is not touching anymore.
I want to achieve the same effect as the box/cylinder but instead as a capsule. If possible I would like to do this without a raycast because I thought maybe there could be a way to simulate another shape (like having a separate collider under the player that only activates once the player is standing on an edge? Or some sort of method that extends the capsules lower collision diameter.
When you launch press the X key to debug in third person mode so you can see what I mean. I changed the collision to a cylinder (now if you move over the edge of a platform it does not fall off). You will see what I mean.
Like Leonidas pointed out - I want to achieve the same effect with a capsule and not cylinder.
Perhaps it is an option to temporarily switch to a kinematic rigidbody or to make the collider larger than is actually necessary? I don’t think there is a simple solution without having to make concessions. And it’s hard to think along with you because I don’t exactly understand why the current solution with changing the friction is not enough.
The friction solution only works to some extent it is not what i want exactly. It still slides off the platform but has better grip, does not extend the collision body fully.
I want to be able to achieve what is on the picture but with a capsule collision instead. There is a another solution from another link that I provided where the body is lifted up slightly so it simulates a cylinder type collision feel but I have trouble understanding its logic.