How to create different camera for FPS weapons?

hey there !
for the camera, just change its properties using the camera manager , like change the focal lenght to the value you want when you change the weapon.

for the clipping it s more complicated,
see here : Render mesh over the world, DepthPriorityGroups? - C++ - Unreal Engine Forums

the best method would be to use the collision system to prevent the weapon from clipping inyour scene.

or here is an idea :
render your weapon and animation outside of your scene (might be tricky to get same lightning/shadows) with same camera settings, and render this to a render target, and composite it on top.


I want to create a different camera for the FPS weapons and elements which show the gun and hands with a fixed FOV so that my animations dont look bad when I change the FOV of the main camera. See this video from 3:36 to know more - How Great First-Person Animations are Made - 10 Tips for Animating FPS Characters/Weapons in Blender - YouTube

I also want the weapon not to go throught walls when we are close to them. This is implemented in almost every FPS game and it works very well.

How can I achieve in UE4? Thanks

You are talking about camera switching which is easy in Unreal.

What I did is I have a TPS Camera and one attached to every weapon where I set it so it covers the aim down sight.
And I switch between them when I need with
“Set View Target with Blend”

he is not talking about camera switching.
he wants to render the weapon model using camera A and the scene with camera B and combine both images to one render target.

Here is a tutorial on YouTube I made, Separate Field Of View For Weapon Camera - UE4 FPS Camera [1/5] - YouTube