Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Kinematic vs. manual physics for main player?

Discussion in 'Getting Started' started by tristanwheeler, Jan 11, 2016.

  1. tristanwheeler

    tristanwheeler

    Joined:
    Jan 11, 2016
    Posts:
    2
    I'm just getting started with Unity. I've been reading that it is not advised to directly manipulate the game physics of the main player you're controlling - this true? I learned a little bit about simulating physics through a book called "The Nature of Code" by Daniel Shiffman and want to apply some of this knowledge to games in Unity.

    Example: I starting out making a 2d Game where an object follows the mouse by using .addForce on a RigidBody2D attached to the player ,controlling RigidBody physics with code etc...

    I'm very interested in simulating physics and want to make games with sensitive/organic interactions. Animating the main player with transform and relying on the Unity physics engine for interactions with other objects seems like it could get confusing if you want to get information about the overall velocity, acceleration, drag etc. acting on the main player being controlled. Seems like I would have to keep track of two different sets of Vectors for everything effecting my main player's motion for an involved game.

    Hopefully I'm making some sense. Do some people use Unity without Kinematic objects and have everything controlled by game physics?
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Yes, many people build their games entirely around the built-in physics engine. If you're making the next great Angry Birds clone, this is almost certainly the way to go. (Handling collisions is especially thorny to code yourself.)

    On the other hand, for High Frontier we had to roll our own physics engine in order to get some of the finer aspects of rotational dynamics right (see these blog posts for example). And in a lot of my more casual games, I simulate my own physics just because I find it easier, and I can have finer control — see this article for example.

    So, since you're just getting started, I urge you to accept that you can use whatever combination of custom physics and engine physics eventually make sense for your game, and forget about it for now. Work your way through the Learn section (see the link at the top of this page) methodically, have fun rolling balls and making simple roguelikes and platformers and whatnot, and in 6 months or a year, return to your magnum opus. You'll know what to do then!
     
    Ryiah likes this.