(Solved) Can I have a physics object in a non-Physics game?

Discussion in 'Programming' started by Evan Malinowski, Dec 6, 2018.

  1. Evan Malinowski

    Evan Malinowski Member

    Joined:
    Apr 17, 2018
    Posts:
    207
    I want to have an object use physics, but the game I have does not use physics, would this cause problems or is it okay to do it?
     
  2. Pyxus

    Pyxus Member

    Joined:
    Nov 6, 2016
    Posts:
    183
    I can't speak for overall performance, but short answer yeah. Even games that center around physics will have tons of non-physics objects. So long as you're not trying to move non-physics objects with physics, or vice versa.
     
  3. Danei

    Danei Member

    Joined:
    Mar 23, 2018
    Posts:
    47
    I think I've seen a bunch of different experienced users advise against using the built-in physics engine for anything except physics games, but I've never used it so I don't know exactly why.
     
  4. Pyxus

    Pyxus Member

    Joined:
    Nov 6, 2016
    Posts:
    183
    I'm definitely not one of those "experienced users", but from my understanding of it, part of the reason is it's just unnecessary most of the times. The physics engine can give you a fire and forget collision system, but you just don't need to simulate physics if your game is a standard rpg, or a platformer like mario; Its lazy and generally bad practice. Now if you're making a game like angry birds, the physics system may swiftly become your best friend.
     
  5. Jezla

    Jezla Member

    Joined:
    Jun 20, 2016
    Posts:
    407
    The physics system is pretty much all or nothing. It is possible to use a non-physics object in a physics world, but it's inadvisable, because there are probably ways within the physics system to accomplish what you would want to do.

    However, you should NOT have an object use physics in a game that doesn't use physics. It won't work, and you'll cause yourself all kinds of problems. As @Pyxus said, physics is only suited for games that rely on physical simulation (Angry Birds, Pool, Pinball). See this thread.
     
    Evan Malinowski likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice