Pick up an object.


I would like to know how I can make an object (a weapon) for example that when I go over i t with my controller, it appears and follows my main camera and disappears from the floor. Just like I picked it up. Please help with an explanation and/or a javascript/C#. Thank you.

Sounds like you need Mouse Picking and then use addforce on the picked up item towards the “holding point” use drag so the object slows down to a halt when it reaches the holding point.

If you don’t want your objects to be rigidbodies (though I would recommend them to be so collision will work) you can use Lerp or Smoothdamp to move an object towards the holding point as it moves. I wouldn’t do this because the first thing players are going to do when they pick something up is try to hit it against something else, and you won’t be able to do that without colliders. :slight_smile: