EVERYVIEW

How to make a simple Unity Game
Pt.2

Step by Step Tutorial
By: Kevin Park
Part 1

Adding Interactable  Items

Create a 3D Object Cube, Sphere, Capsule or Cylinder
Picture
Name the item "Interactable"
Picture
Resize the interactable however you want. I chose to make the scale X:0.3, Y:0.3, Z:0.3.
Picture
Click on the tag dropdown, and click on Add Tag.
Picture
Name the tag "interactableItem" and click save
Picture
Click on the interactable 3D object and click tag then click on "interactableItem"
Picture
Drag in the 3D object into the prefab folder and it should appear as so
Picture
Now you can delete the 3D object from your hierarchy 
Picture
Open the movementScript file in your scripts folder. it should currently look like this.
movementScript

    
Add the new lines of code where it states above
interactable script

    
Go back to the unity application and then drag one of the interactable items from the prefab folder onto the ground. and raise it up so it's not inside of the ground.
Picture
On the interactable item's Box Collider in the inspector menu, check "Is Trigger" so that it's on.
Picture
Click the play button to test the game and when you run into the interactable item, it should disappear and you should get the message ​"Touched the interactable item." in the console.
Picture
Picture
We will continue to work on interactables when we work with the UI and scoring.
FACEBOOK
YOUTUBE
TWITTER
Instagram
Everyview 2020