I am currently working on a very simple 2D game with very simple physics. I mean balls bounces, vortex, some kind of gravity, nothing more.
First, I don’t know much about the physics part of Unity, but I would like to have something optimized and I need control on it.
I first tries to use forces and some kind of mix by resetting the velocities, calculating bounces angles, adding forces again on collision enter etc. but I don’t think this is the good way to go. The good thing is that by doing this I can use all the fancy stuff from Unity without having to code everything by hand.
I also tried to use kinematic rigidbodies for my sphere but it doens’t collide anymore with my collider and I think that I won’t be able to use reflectors, forces etc. anymore.
To sum up I am a bit confused and I don’t know where to start.
So all physics professional, I would like to hear your thoughts about this, what workflow should I follow ?
Thanks a lot !
If the game is a simple physics game then Unity’s built in physics should be just fine. Use Rigidbodies and physics materials. What specifically doesn’t work for you?
You can use kinematic rigidbodies but you will have to write your own physics interactions. It’s not difficult but it is time consuming. The nice thing about doing this though is that you can control every aspect of it.
Then of course you can do a hybrid with some non-kinematic and some kinematic rigidbodies for those that have complex interactions.
I think we need more info though to determine what’s best for your setup. Although, from the initial statement I don’t see why using the built in physics won’t work.
Thanks for your answers. I finally decided to to the physics behaviours myself as they are very simple and limited. With this I have more controls over what happen and from what I’ve read it seems also more optimized.
So I am not using the force anymore but simply moving rigidbodies and check for collision and triggers.