Hello, what would be the easiest solution to have an all-in-one movement for all needs: Walking on level surfaces, uphills, downhills, stairs and so on.
What has been tried and discovered
Movement using forces:
- Gravity significantly changes movement, with standard -9.8 gravity, stairs, hills and other obstacles work perfectly, but when jumping/or the player falling in the air, other solutions are needed.
Solution 1: When the player has no contact with other rigidbodies, setting the gravity to -40 to create a faster/more realistic fall effect.
Disadvantages: When the player starts to touch the rigidbody again, the movement is slowed down for a while, the stairs do not work as they should (collision detection instability, start, end, start, end) because the gravity is too high and the movement force is too low.
Solution 2: The same gravity is maintained, when the player is not in contact with the rigidbody, a downward force is given.
Disadvantages: Instability, “gravity” is different between jumping and free falling.
Movement using teleport:
- Strong -40 gravity perfectly copes with falling, jumping, does not take into account obstacles, stairs and uphills, etc. works perfectly, but when the player is teleported (Walking) you may encounter strangeness, since gravity is ignored.
Falling without walking works perfectly, only by pressing any movement key, sometimes you can “walk in the air” even though the force of gravity is high.
I haven’t come up with a single possible solution, do you have any ideas? For some reason I want to stick to moving with teleport, I am looking for a solution that does not take into account obstacles and is suitable for practically everything, the biggest problem is “walking in the air”.
Thanks for any information or examples