Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Start Advice for a Vehicle Building Game

Discussion in 'Game Design' started by Andy1UP, Jun 27, 2016.

  1. Andy1UP


    Jun 27, 2016
    Hi, I just need a little advice on how to start a vehicle building physics game something like besiege or scrap mechanic just a game example. the question is how would i get to starting it out with a center block or some other way which way would be the best. Any other advice will be appreciated as i am quite new to unity but not to programming.
  2. Reaven99


    Oct 3, 2015

    I have made an engine like this some time ago which works pretty smooth.
    I created the blocks like this:
    A collider on each side of the block to check for raycasts of the mouse.
    I did this so i could check wether the player is aiming at it.

    Now you now what side of the block you need to spawn another block, Simply instantiate and use the "LookAt" function to look at the block you were aiming at and place it with an offset on the Z axis.
    This system can be used for any block you want like wheels,armor,cannons etc.

    With this kind of system all you have to do is create box colliders on the blocks/pieces in order to being able to place a new block, which gives you alot of possibilities.

    The thing with these kind of games is the physics, i started out with giving each block a rigidbody.
    I did this so i could explode the vehicle and the blocks would be flying everywhere, this is pretty neat for sure but performance wise it was really bad.
    For a small vehicle it has no performance issues but people dont want small vehicles they want something with 100+ blocks etc, and if they can multiple of those vehicles.

    My fix for this issues was pretty simple, i created a parent and added a rigidbody to it.
    No more rigidbodies for each block, but instead i added animaties and particle systems to the blocks so if they got destroyed they would still fly and burst into small particles.