How To Make Win Containers


Step 1: Check the pre-made win containers to see if there are any that will match your experience.

In this project, we have given you pre-made win containers that you can use. These are located in Assets/Pre-College/Prefabs/Win Containers in the Project Window.

If you like one of the already existing win containers, then there’s no need to continue this tutorial! Just drag the prefab you like into your scene.


Step 2: If you want to make your own Win Container

  1. Create an empty GameObject in your scene (I will name mine Win Container).
    • Depending on what kind of Win Container you are trying to make, you may or may not want to add a Rigidbody to the parent GameObject you just made.
    • For a non-moving stationary box like in the following example, it is not required.
  2. Add your model to the GameObject you just made as a child GameObject (I’m going to use the crate model).
(Optional, but recommended) Add the Select Base component to your parent GameObject.

This is a component that simply prioritizes selecting the object it is attached to when clicking on an object in the Scene View. With this component attached to your parent GameObject, when you click on its child model, it will select the parent GameObject rather than the model’s GameObject.


Step 3: Ensure that you have collider(s)for your Win Container.

Reminder: For more complex models, you can have multiple colliders on one GameObject.


Step 4: Make a trigger cube.

This GameObject will detect if a Win Object enters it.

  1. Make a new empty GameObject and give it a Box Collider.
  2. On the Box Collider component, enable the Is Trigger variable.
    • This disables normal physical collisions for this collider and has it act as just a sensor for coming into contact with other colliders.
  3. Adjust the Box Collider until it covers the empty space of the win container.
  4. Add the Win Container component to the GameObject.
  5. Your Win Container should now be fully functional!
    • Don’t forget to make it a Prefab by dragging it from the Hierarchy Window into the Assets/_Prefabs folder in the Project Window.

Step 5 (Optional): Add sparks that fly out whenever a Win Object is placed in the Win Container.

  1. Add the SparksParticles prefab from Assets/Pre-College/VFX/Sparks to your Win Container‘s parent GameObject.
  2. Select the SparksParticles in the Hierarchy Window, and reset the Transform‘s position values to 0,0,0 in the Inspector Window.
  3. Test the Particle System by clicking the Play button in the Scene View.
  4. Adjust the Position, Rotation and Scale of the SparksParticles object.
  5. Assign the SparksParticles object to the Sparks variable in the Win Container component in your Trigger Cube object.

Next Steps:

  1. Make a win object
  2. Set up your NPC