See if the camera can see the part

Hi everyone, this is a module to help you from optimization to new features in your game.
A lot of people wants to see if a camera can see a part but infortunately Roblox didn’t add this feature, so i did it.

Why would i use this module?

With this module you can make useful things like:

  1. Make parts that the camera doesn’t see invisible.
  2. Make something like SCP-096
  3. Activate a mechanism or do something when the player is(isn’t) looking at it, and much more.
    This script uses a more complex and optimized way to do it’s job
Version Note

Version: Alpha-1
Feature:
-Detect if a part is visible to the camera.
-Spawn a camera at a given CFrame and detect if a part is visible to the camera

This module and this post is under development

Module Link:

I hope this module helps you.
:smile:

Updates to come:

For Alpha-2:
Default Configurations.
Z cliping plane(minimun position, default being vector3(0,0,0)).
Better instructions in the ReadMe.
Maybe a better optimization.
A test place(a showcase showing the module)

For Alpha-3:
Ignore small parts that are blocking the part(you will see it when i update it).
Range based on graphic level or a render distance.

For Alpha-4:
Don’t ignore invisible parts with a transparency 0 decal blocking the camera view.
ViewportFrame support(i am unsure if it will arrive at Alpha-4 but let’s hope it does[0.001% of chance]).

For Alpha-5: Coming Soon.

11 Likes

As a contribution, the description link is moderated


Change it to this: https://devforum.roblox.com/t/-/2037505

2 Likes

Do you think it would make more sense and be less redundant if these two functions were merged into one, where it accepts a camera variable and defaults to the workspace.CurrentCamera if one wasn’t provided?

1 Like

no, the CheckIfVisibleCam is for CFrames and the CheckIfVisible is for already existing cameras

thanks for the help.
updating it’s description

I don’t mean to negate the usefulness of this resource and I have not seen the source code myself, but based on the images it does not appear you use the built in way to check (correct me if I’m wrong). Here is the built in camera method to check if something in the world is visible to a camera: Camera | Roblox Creator Documentation

Hi, yes i use it for optimization to see if the positions are in the screen but as the documentation says the WorldToViewportPoint() will just tell if the position is in the screen, so then we need to use some raycasts.

1 Like

And WorldToViewportPoint() gives false true because it just check if a vector3 is in the screen and not if the vector3 is in the screen and there is nothing blocking it

ive been wondering how to do this for years, i will try it out

2 Likes

THis is an important warning, it seems that the system isn’t working correctly, it will be fixed in the next update.

Important News, the Module will be re-made from scratch.
A new system will be implemented