I have been looking for hours for a solution and I am still so utterly confused. Please note that I’ve used a free script found online and have no experience in scripting. My aim is to use a proximity prompt on models so people are able to view what the models are wearing. For some models it works perfectly fine, but for others its either: the proximity prompt is far away from the model or not showing at all. With click detector is shows most of the outfits but for some it still doesnt show all. The script is placed in ReplicatedStorage, I have tried enabled and disabled line of sight, as well as putting it in a part but still nothing works. Here is part of the script which includes the Proximity Prompt:
for _, OutfitModel in pairs(OutfitsFolder:GetChildren()) do
-- Set the display distance type to none
local Humanoid = OutfitModel:WaitForChild('Humanoid')
Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
local Prox = Instance.new('ProximityPrompt')
Prox.MaxActivationDistance = 25
Prox.Parent = OutfitModel
Prox.HoldDuration = 0.5
Prox.ObjectText = "TextHere"
Prox.ActionText = "TextHere"
-- View outfit if an OutfitModel is pressed
Prox.Triggered:Connect(function()
local HumanoidDescription = Humanoid:WaitForChild('HumanoidDescription')
OutfitViewerController:ViewOutfit(HumanoidDescription)
end)
end
Click Detector:
for _, OutfitModel in pairs(OutfitsFolder:GetChildren()) do
-- Set the display distance type to none
local Humanoid = OutfitModel:WaitForChild('Humanoid')
Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
-- Create a new proximity prompt
local ClickDetector = Instance.new('ClickDetector')
ClickDetector.MaxActivationDistance = 25
ClickDetector.Parent = OutfitModel
-- View outfit if an OutfitModel is pressed
ClickDetector.MouseClick:Connect(function()
local HumanoidDescription = Humanoid:WaitForChild('HumanoidDescription')
OutfitViewerController:ViewOutfit(HumanoidDescription)
end)
end
I will be so grateful if someone helps me solves this. I want to be able to use proximity prompt, so players can view the outfit, on all models with no problems.