keyframe object in and then out of scene Imagine I am going to take a gun out my pocket and then fire

I can keep the gun next the side of the pocket. How do I keep this out of the scene but then into the scene as my character picks the weapon?

In any other instance where one would like an object to not appear in the scene but then appear. How does one do this?
Object visibility can be animated (keyframes):



Two visibilities: one for viewport and one for rendering. You may need to keyframe twice.

To add a keyframe, place the timeline where you want then change the visibility checking or unchecking the visibility, then:


Either place the mouse cursor on the check box and use I
Or use RMB on the check box and choose 'insert keyframe'




So you can blink an object: