Welcome back! This week's blog is a continuation of our last one, so if you haven't read it please read it now (it wont take long I promise). Last where we left of, I created a pill shaped object that can move a round based on your directions. The speed of the object however, is constant. To change that we will be using the Unity physics system and create rigidbodies/colliders that the object can run into to slow down. First we create the thig we bump into, lets say a circle.
When looking at bumper cars, you'll notice an inflated ring surrounding the car itself; that is basically what we are going to do. By going to the components of each sprite and adding the colliders, we command the game system to not allow these sprites to pass through each other or to slow down when touching. This even allows the user to push the objects (this idea can be used to create a game on its own). To make the sprite be able to move you must also add a rigidbody component to the player sprite (which is the pill shaped one) and remove gravity since we don't want it flying off. Do the same with the other sprite and voila.
Sorry to say but that's it for this week. To be honest I was dead tired with exams and everything so time and energy were really scarce, Hopefully next weeks 3D design blog will make up for it. Thank you for reading!
Comments