How to reduce the transparency when DevCameraOcclusionMode = Invisicam?

I ran several tests and reached some important conclusions:

  1. It’s no use changing the LocalTransparencyModifier value inside GetPropertyChangedSignal("LocalTransparencyModifier"). Roblox will not accept this change and will re-force the value 0.75 every time.
    Here a project that’s showing this: invisicam.rbxl (26.4 KB)
  2. When two or more parts are together, with no space between them, the value of LocalTransparencyModifier will fluctuate between 0.75 and 0.5 (as reported here):
  1. Finally, the DevCameraOcclusionMode = Invisicam property acts for ALL objects, so I can’t specify a blacklist or whitelist for which objects I want to be affected by this property.

Taking all these restrictions into consideration, I conclude that it is easier and more flexible to create a Raycast script between the camera and the character, leaving only the parts that interest me semi-transparent.

2 Likes

I suggest using @debugger57 ‘s solution. You only need to change one variable, and if you are scared that you’ll miss an update, change the PlayerModule every once in a while. To me it seems like the easier solution.

Or, if you want to get really technical, you can copy the code inside the Invisicam module and make the appropriate edits (which could take a bit).

If you need any help or suggestions let us know.

3 Likes

You’re right. It really was the simplest solution. I only realized this after getting hit a lot with all the bugs I reported above. I was already developing a whole ray method as I mentioned before, but your answer came just in time.
I was not aware that it was possible to hack this script.
Thank you for your insistence and your patience.

@debugger57 Thank you for your effort and your solution. There was only one problem when duplicating the original Invisicam script, showing the warning about Humanoid.Torso deprecated:

Changing by Torso by RootPart solved the problem:

2 Likes

Well, there is only one remaining limitation, which I commented on before: Invisicam acts on ALL objects. How to create a whitelist or blacklist to choose only some objects to be affected by transparency?

2 Likes

Camera | Roblox Creator Documentation has an ignoreList property you can use.

1 Like

Yeah, I also see that in the original InvisiCam script there are mentions of GetPartsObscuringTarget.
I just don’t know how to add items to the ignore list of this script.

2 Likes

In the second argument of the function add a table of all the parts you wish to ignore.

1 Like

Adding onto this, you should make a variable at the beginning of the Invisicam script, that looks like this

local IGNORE_PARTS = {}

Then, like @Abcreator said, add the IGNORE_PARTS variable to the second argument of the function.

2 Likes

I mean, how, in my LocalScript I will interact sending this ignorelist table to my current hacked Invisicam script?

2 Likes

Use PlayerModule as I explained in my post before. It should be put into StarterPlayerScripts.

1 Like

Yeah, I already did and it’s working as I said before.
image
But my question now is how can I send my current ignore list table that is located in my Localscript to this hacked script.

2 Likes

Put the table in the hacked script, not in the LocalScript. Then, find where the Invisicam script uses the GetPartsObscurringTarget function and add the table to the second parameter.

2 Likes

I can’t, this table is generated and controlled by LocalScript and is vital for the game.
I already understand what to change in the Invisicam script, but I would just like someone to tell me how do I communicate my Localscript with the Invisicam script

2 Likes

Oh, I see. You may need to create ObjectValues in the Invisicam script through the local script. Then you can use the Invisicam script to go through all the object values, get the value, and add it to a table.

3 Likes

I wouldn’t call this a hacked script, it’s just an edited script.

3 Likes

Yeah, BaseValue objects is probably the best solution in this case, as you can seemlessly share data between scripts. Also, @rogeriodec_games , you can use unpack() function to easily integrate your blacklist into the blacklist table of Invisicam script:

1 Like

I haven’t tested it yet, but does it mean that if I have 1000 objects to blacklist, I will have to create 1000 ObjectValues?
I don’t know if this will be good for the game’s performance.
This is getting more and more complicated.
It was supposed to be simple: make Invisicam be activated only for parts of the ceiling and walls, which are few.
In this case, instead of ignorelist, it would be easier to whitelist, as in the case of raycast.

1 Like

You can also use ModuleScripts.

True, I’d use an “if” statement for that. Check if a part is in the whitelist and make it transparent, or leave it normal if its not in there.

So it is.
Maybe now the solution is to use the “edited” (not hacked :smile:) Invisicam script just prevent the parts from being transparent, as the original @debugger57 solution.
And so, I should keep working on my local raycast solution so I can have more flexibility with a whitelist.

3 Likes

this didn’t worked, but i founded how to do that.

you can check out my post here