Quantcast
Viewing latest article 11
Browse Latest Browse All 33

Answer by kburkhart84

Generally, the character is not actually directly controlled by physics. The problem is that for the most part, game characters don't move all physics based like that. Your character would normally be able to accelerate, stop on a dime, turn around, etc... all that is not something a normal physics setup would be able to handle with ease. Most games that I've seen that are physics based are not moving the character's themselves with physics, rather via normal translation and rotation, unless the character is actually something that should be physically simulated, like a spherical character or similar. You would still have a rigidbody and collider(probably capsule) on the character, but it would be set to kinematic, which allows you to directly control it, and won't let physics affect it, but would let it affect physics. So a box moving down a hill would not push the player with it, rather the player would affect the box, making it stop or go around, depending on the situation. But, static colliders could indeed not let the player go through, while non-static colliders would be affected, example, the player could push boxes around by simply walking into them. If you insist that the player be physics based, there are some things you can do. Physics properties can be adjusted though scripting, for example the drag and angular drag can change at any given time, as I believe so can the gravity, and other things. So you could have the drag be lower when the character is falling so that it can fall faster, then turn up higher to control movement speed, and whatever tweaks you need to get it right. But just remember that it may be easier to get the player working better with your own movement code instead of the physics engine.

Viewing latest article 11
Browse Latest Browse All 33

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>