0
\$\begingroup\$

I have a prefab with 2 cameras. the 1st is rendering the world, the 2nd one all the suff in front of the 1st person characters "face". Now i have a problem with a gun using a muzzleflash - both on the deapth only camera. The muzzleflash is on the very front tip of the gun and i assume because the 2nd face camera is set to "deapth only" it causes the muzzleflash to be off place. I came up with 3 ideas

1: changing the layer of the muzzleflash to world for some frames everytime a muzzleflash appears

2: having a 3rd camera rendering the muzzleflash only

3: adjusting the gun on the face camera, the muzzleflash on the world camera

I assume the 1st two options have a huge overload, i prefer the 3rd one. But is it a good way to do it? How should i proceed in this situation? Or how do others?

I also have animations so it can appear on 2 positions, normal and scoped.

Edit Here is an image i added Debug.Break() as it was instantiated, its totally correct aligned.

enter image description here

\$\endgroup\$
  • \$\begingroup\$ Can you show us what "off place" means in this context? \$\endgroup\$ – DMGregory May 14 at 1:11
  • \$\begingroup\$ I have edited my question \$\endgroup\$ – MBrain May 14 at 1:23
  • \$\begingroup\$ The depth only clearing setting does not shift the position at which objects are drawn on screen, so you'll have to give us more details of your setup for us to be able to diagnose what's going wrong here. Do both your cameras have exactly the same position, orientation, and FoV? See if you can give us a set of steps we can follow to reproduce this type of issue in a brand new empty scene, to eliminate as many potential variables as possible. \$\endgroup\$ – DMGregory May 14 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.