do you know how to make it transparent, without the animation bit?
Hi mate, I was finally able to do this with animation. I did it with DOTween, which is an amazing addon to Unity and Playmaker.
To do this without animation you can follow these steps:
1 - Add a Raycast from the Camera to the Player
2 - Add a new Layer called Transparent (whatever name you want) and assign it to the objects you want to make transparent
3 - On the Raycast FSM add a Layer Mask of value 1 and select the layer you created (this will make the Raycast only hit selected layers)
4 - Make sure you have hit object saving a variable
5 - Add a new state with "Set Visibility" and in the object the Raycast just hit and untick the "Visible" if it's ticked
6 - In the same second state add a "Next Frame Event" and send it back to the first state (makes sure when the Raycast isn't htting anything everything goes back to normal)
I can post a screenshot in here later of this process. If you want it with animation I can post it in here too.