How to fade out the player's head and accessories when they're too close to the camera?

Hello!

In my game, the player is in a close third person view. This is for gameplay reasons such as a meter that will soon be on the players back.

The problem is often times the players head and accessories can obstruct the camera when doing quick turns.

I need a way to prevent the players accessories and head from obstructing the camera. Yes, I have attempted this twice before, both attempts have drastically failed.

Thank you for your help, I really needed it!

I imagine getting the distance of the camera from the player’s model’s head is some simple vector3 math, since both of them have cframes that dictate their position. Both the player’s head and camera can be referenced with local scripts, and since this is, as far as I’m concerned, only a visual mechanic, it should be fine to run purely on client-side and avoid any unnecessary firings of remote events. Upon getting into a range, you could just set the player’s head’s transparency property to something higher.

1 Like

You need to make a prerender loop where you check with magnitude if character’s head position is close to camera’s cframe.position, if you want to fade out head accessories only, you’ll need to check the attachment names, if not, then just set all their baseparts localtransparencymodifier and you’re good

1 Like

You both have been very helpful, I’ll apply and send results when I figure it out!