OndrejNepozitek / Edgar-Unity

Unity Procedural Level Generator
https://ondrejnepozitek.github.io/Edgar-Unity/docs/introduction
MIT License
820 stars 70 forks source link

Fog of war gliitching when usiing cinemachinecamera shaking by multichannel perliin #124

Closed matheuscamargodev closed 10 months ago

matheuscamargodev commented 11 months ago

The fog of war is glitching when i implemented a camera shake feature after a attack from character. When the camera shakes, the fog glitchs and moves off where supposed to be. How to avoid it?

OndrejNepozitek commented 11 months ago

Hey, what's your setup? Unity version, URP/Builtin pipeline, maybe a screenshot of your camera setup?

OndrejNepozitek commented 11 months ago

Hey, I investigate the issue and the problem is that the Fog of War doesn't work if a rotation is applied to the camera. And the default noise profiles in Cinemachine are made for 3D games and they all apply a rotation to the camera which doesn't make sense in 2D I guess.

You can create your own NoiseSettings asset from the Cinemachine right click menu and create a custom noise. In that noise, set only the Position X and Position Y components and keep all the other components at zero (mainly the rotation). Then select this profile in the Noise configutation in the cinemachine camera and it should work.

matheuscamargodev commented 10 months ago

Sorry for the late reply.

That was amazing. Solved the problem.

Thank you so much!