Hello everyone, i got a rigidbody character controller to allow me to push the player ,knock in the air,etc.
The only problem is some locomotion element are very problematic.
Basicaly i want to find a way to avoid like the first example instead getting something more similar to the character controller(note like said before i cant use character controller).
The First idea that came to me was maybe use a sphere collider act as a sort of “wheel” that would be push by the terrain up and down but i don’t really know how i will do that.
Thanks for your future respond and good luck in your own project.
The way this is usually done with things like custom kinematic rigidbody character controllers is you shoot down a raycast a bit infront of your players feet to the floor to detect if there is an object, and if so then calculate the distance required to have your character be ontop of said object and then move (teleport) your player up.
You, on the otherhand, are using a non kinematic rigidbody and are moving with addforce and what not (Im assuming). The issue you may run into with the method above is the teleport part. You cant really just addforce since that adds to your velocity and you will keep going up, and if you use moveposition then you have no collision detection.
You might get away with using addforce and then the next frame removing the extra added velocity, but that might be unreliable.
Its to bad unity doesnt have a decent character controller (one that rotates…). I got fed up with dealing with rigidbodies (they dont event handle collision well…) and am currectly working on getting basic collision detection.
I saw this in the past
Im trying to do collision detect with spherecasts and what not, but that site seems to have a more advance method using the meshes geometry. Maybe you can have a look at that instead of rigidbodies.
Thanks for the answer, i find a solution to my problem, i discover this asset https://www.assetstore.unity3d.com/en/#!/content/15672 the second version will be out in the middle of the month.