Search Unity

How Do I Make a Training Simulator?

Discussion in 'Editor & General Support' started by Kingsburry, Feb 15, 2019.

  1. Kingsburry

    Kingsburry

    Joined:
    Jun 15, 2018
    Posts:
    16
    Hello,

    I am trying to work on a manufacturing simulator where I want to be able to take those Red Bolts and place them into that Grey module. However, I am not knowing where to proceed from here. I don't quite know what to do so I can grab the bolt and place it in the hole. Now I do have the bolt and grey plate already being able to interact such as just simply grabbing it and picking it up. Now I would like to move onto grabbing the bolt and just placing it in one of the holes successfully. Would anyone be able to lend some assistance on what to do next to help me out? Sorry for such a dumb question, I'm new to Unity and trying my best.

    Thank You!

     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
    How accurate do you need it to be? The simplest thing is to put a trigger collider over each of the holes to detect when the bolt is directly over the hole. Then onTriggerEnter just set transform of the bolt in it's final position and make it a child of the grey piece. Also deactivate the interactive component of the bolt, unless you want the user to be able to remove it.
     
  3. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,778
    Yep, I also would go for simple collides triggers, which detect right type of component.
     
  4. Kingsburry

    Kingsburry

    Joined:
    Jun 15, 2018
    Posts:
    16
    Hello,

    Sorry for such a late response on this my apologies! I have looked up a youtube video from the Unity website on the trigger collider like you talked about. But I'm lost as to how to even make a trigger collider over each of the holes to detect when a bolt is directly over the hole. This would literally be perfect to show for an example, but looking online I have 0 idea what to do for the coding aspect in doing this. Would you be able to help push me further in a direction on where to go from here?

    Thanks again for commenting I greatly appreciate any feedback!
     
  5. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639