Pick Up & Drop Controller

lightonoff.cs

Size: 0.47 KB

You need to login to download this file.

ObjectController.cs

Size: 4.16 KB

You need to login to download this file.

In this example i will be using a working flashlight

  1. Add the PickUpContoller.cs script on the object you want to be able to pick up
  2. (flashlight) Add the Lightonoff.cs script on your object 
  3. Give your object an
    1. Rigidbody
    2. Collider
  4. Drag your playermodel, Main Camera and the Rigidbody and the Collider you just made into the PickUpContoller.cs script
  5. Create an empty object that will be the parent (container) of the object

It will hold the object in this object, so make sure it is in the right position, scale and rotation. Align it to match the desired position of the object

  1. Drag the parent (container) into the object container field
  2. Create a new text field to display a informative text
  3. Insert the text you want to display when getting close
  4. Drag the text object in the empty text field
  5. Provide values that fit your project
  6. (flashlight) Add the script from the object you want to disable when it is not equipped, in this case the Lightonoff.cs script

recommended