I ran several tests and reached some important conclusions:
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)
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):
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.
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).
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:
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?
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.
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.
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
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.
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:
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.
So it is.
Maybe now the solution is to use the “edited” (not hacked ) 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.