I am playing around with a VR game where the player can fire a hand gun. When the magazine is empty they can press a button on the controller to eject the magazine from the gun. As its VR, I would like to have the player be able to pick up the magazine again, if they need to.
Currently when the eject button is pressed, the rigidbody of the magazine is enabled and it falls from the gun.
My question : The player can hold the grip side pointing up and the magazine will drop through the gun or hold the gun sideways and the same will happen.
If the player hold the gun in any of these orientations, the magazine needs be released but stay in the grip and only slide out as the gun is turned so that gravity pulls it.
My first instinct was to use code to animate the magazine and only enable the rigidbody when it leaves the gun. Another way to use 5 box colliders to emulate the walls of the grip and that way contain the movement.
I was just wondering if there was a better way to do this.