Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Asking for help about a simple physics game

Discussion in 'Physics' started by MaT227, Mar 13, 2018.

  1. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    607
    Hi there,

    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 !
     
  2. StickyHoneybuns

    StickyHoneybuns

    Joined:
    Jan 16, 2018
    Posts:
    186
    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.
     
  3. BoogieD

    BoogieD

    Joined:
    Jun 8, 2016
    Posts:
    146
    Yeah, I agree but didn't answer because of limited info. You don't usually need to fight the physics system by altering velocity. 'Use the force'.
     
  4. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    607
    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.