This is my first ever post and i just simply cannot find anything like this, ive spent ages looking for a solution and just cannot find one
My code is set up for a serverscript to add a model to the player’s character if a value is met, now this all works fine and i have everything set up, but due to the game being first person, the model is invisible.
My issue is that the model is invisible, its clearly there when i look on the server, but the client makes it invisible. I want the model to be clearly visible.
As far as i know, model’s dont have a LocalTransparencyModifier, and i have tried using that technique to fix the issue but nothing.
The model has to be parented to the player as all my code relies on that.
If any more info needs to be provided ill try my best to supply, any support would be much appreciated
updated! ty im new to this (expanding reply for the character limit)
1 Like
the solution I could see is looping through a models descendants and seeing if it’s a part. if so, make the modifier to 1.
local Character:Model = script.Parent
local Model:Model = Character:WaitForChild("Modelname")
game:GetService("RunService").RenderStepped:Connect(function()
for _,v in Model:GetDescendants() do
if v:IsA("BasePart") then
v.LocalTransparencyModifier = 1
end
end
end)
tried this, with a slightly modified piece of code:
local Character:Model = game.Players.LocalPlayer.Character
local Model:Model = script.Parent
game:GetService(“RunService”).RenderStepped:Connect(function()
for _,v in Model:GetDescendants() do
if v:IsA(“BasePart”) then
v.LocalTransparencyModifier = 1
end
end
end)
The script was placed in a local script inside of the model that gets parented to the player
I tried with the transparencymodifier being set to 1, as you suggested, and to 0 aswell. Both of these didnt do anything to help with the issue
My model consists of unions too, if that matters. however even the parts in the model werent visible from the client
yeah that won’t do anything. instead you need to make it a normal script instance, and then in the properties turn the “RunContext” to client. this will make it able to run anywhere because by default localscripts only run in certain places.
or parent it to PlayerScripts
OHHH THANK YOU SO MUCH ACTUALLY
i never knew about the serverscript runcontext → client trick, but doing that made the model become visible!!
This will be really helpful in the future, thank you so much!
1 Like