(Not So) Fun With Physics Development


So one of the main intended game-play components for Night Plight has always been physics based - pushing around in game objects to create a path to your objective. However, as I quickly learned as a new-to-unity individual, trying to make physics work is in fact witchcraft.


The first issue I ran into was during one of my first bouts of play-testing - there is a short tutorial-like sequence at the beginning of the game where players are informed that small objects around them are often small enough to be moved. The first object they can do so with is a letter cube. As I'd grown used to doing this part, I never really encountered any problems with it. However, playtesters pushed the block further than I did and I quickly learned that pushing it into another stationary object makes Everything Go Wrong. The block jitters and flies off into space, or falls through the floor, or falls into the object its been pushed against. This was, needless to say, not ideal.

So I set to work fixing it! I don't have much experience with mechanics like these, so it involved a lot of research and poking around.

My temporary solution for the moment has a combination of a few things; I adjusted the rigidbody settings on the moveable objects so that it had a mass and drag of 5, set the interpolate to 'interpolate', and adjusted the collision detection to 'continuous dynamic.' I also added a box collider to the object being run into. 

This hasn't been a perfect fix, but has greatly decreased the objects tendency to fling itself across the map. I am as of now still searching for a better solution, and will post more updates in the future regarding it.

Get Night Plight

Leave a comment

Log in with itch.io to leave a comment.