Hey, I have a question why does this decal go invisible in first person I’m messing around with trying to make a realism flashlight but for some reason, the decal goes invisible any ideas why??
here’s a video of the problem:
NOTE: I did make a script using the local transparency modifier to try to see if the part has a local transparency modifier applied to it but it doesn’t.
Ah, there’s the issue. I’d have to look into it a bit more but setting the LocalTransparencyModifier only once doesn’t work. You’ll need to constantly set the LocalTransparencyModifier every frame. I’m not 100% if there’s a better way to do this, but updating one part each frame shouldn’t make much of a performance impact.
Yes, you are correct but, I have already done this here is my script
localCharacter = game:GetService("Players").LocalPlayer.Character
game:GetService("RunService").RenderStepped:Connect(function()
for key, value in pairs(localCharacter:GetChildren()) do
if string.match(value.Name, "Flashlight") then
value.LocalTransparencyModifier = 0
end
end
end)
localCharacter = game:GetService("Players").LocalPlayer.Character
game:GetService("RunService").RenderStepped:Connect(function()
for key, value in pairs(localCharacter:GetChildren()) do
if string.match(value.Name, "Flashlight") then
print(value.Name)
print(localCharacter.Name)
value.LocalTransparencyModifier = 0
end
end
end)
Because the decal is parented to a part, you will need to search all descendants for it, not just children.
Try replacing this line: for key, value in pairs(localCharacter:GetChildren()) do
with this: for key, value in pairs(localCharacter:GetDescendants()) do
and see if that helps.
Alternatively, perhaps your hierarchy can be set up in a way that does not require parenting the part to the character. What goal does this decal serve? Is it possible to achieve that effect with a GUI?
Unfortunately, I am trying some new technique or at least I think a new technique that will allow me to project flashlight lines on a spotlight using a decal.
I was asking around over here about it:
and get descendants fixed it thank you I dont know why I put that there earlier.