Hi! I'm trying to create a simple character, that just walks on the scene, pushes objects, and travels through moving bridges! I found a code that handles the input regardless of the camera's position and it works very well. I have a simple example scene here: - Each floor box does use a Box Collider - The Mummy is a Capsule Collider But we can see 3 major problems : - When pushing the Blue Box, sometimes it gets stuck up and I can't push it any further. - When climbing the rotating bridge, the character moves along with the bridge! Which is perfect. But if I try to walk on the rotating bridge, it rotates like crazy! - It can even climb stairs, but with VERY difficulty, almost impossible. =) I attached the complete project here for those who want to take a look. Would anyone have any idea how to fix and improve these features or do recommend some Assets that will handle all of them? Thanks!
We have an asset (Sticky3D Controller) which most likely solves your problems. You can read about it here.
The Stuck Item when pushing seems to be a limitation of using floor made of cubes each with it's our Box Collider. https://gamedev.stackexchange.com/q...ir-own-box-colliders-pushable-item-gets-stuck There is a lot of suggestions of how to fix it but not a definite one! Has anyone been through this and would know the correct way to solve it?
Give your player a Physic Material with no static or dynamic friction. Rigidbody characters need that on their colliders, or they get stuck constantly. Give it full rotation constraints in the inspector to fix it on the rotating ramp also. Tell me if it helps!
Step handling is a big problem in character controllers, since when the movement vector is aligned to the ground plane, moving forward presses character into obstacle (assuming it is close to the 90 degrees to ground) instead of somehow moving over it. You'll need some method of detecting such "steps", and then apply vertical force to the character to resolve stucking. The easiest way is to project a Raycast in the direction of movement (from the origin slightly above the ground so it doesnt give false positive), and while it is "true", constantly apply upward thrust to the character.
Maybe set the box-to-be-pushed's position to be slightly above the ground, so it'll never physically touch the lower boxes?