In my game there are client-sided highlights that act in place of ProximityPrompts.
Though they function as intended for the first few clones of a room, after a certain point they no longer appear. Aside from that, interaction works as intended.
I haven’t found anyone facing a similar problem to this yet.
Code handling the visuals for the locker. The door uses similar code, so I won’t be attaching it unless necessary. They face the same issue regardless.
local camera = workspace.Camera
local player = game.Players.LocalPlayer
local inLockerFX = game.Lighting:WaitForChild("InLocker")
local UserInputService = game:GetService("UserInputService")
local playerGui = player:WaitForChild("PlayerGui")
local screengui = playerGui:WaitForChild("InLockerVignette")
local lockerVignette = screengui:WaitForChild("ImageLabel")
local TweenService = game:GetService("TweenService")
local door = script.Parent
local doorParent = door.Parent
local camPos = door.Parent:WaitForChild("CamPos")
local proximityPrompt = script.Parent.ProximityPrompt
local highlight = doorParent:WaitForChild("Highlight")
local tweenInfo = TweenInfo.new(0.3)
local tweenInfo2 = TweenInfo.new(0.3, Enum.EasingStyle.Cubic)
local tween1 = TweenService:Create(highlight, tweenInfo, { OutlineTransparency = 0 })
local tween2 = TweenService:Create(highlight, tweenInfo, { OutlineTransparency = 1 })
local tween3 = TweenService:Create(camera, tweenInfo2, { CFrame = camPos.CFrame })
local tweenUI1 = TweenService:Create(lockerVignette, tweenInfo, { ImageTransparency = 0 })
local tweenUI2 = TweenService:Create(lockerVignette, tweenInfo, { ImageTransparency = 1 })
local tweenLighting1 = TweenService:Create(inLockerFX, tweenInfo, { NearIntensity = 60 })
local tweenLighting2 = TweenService:Create(inLockerFX, tweenInfo, { NearIntensity = 0 })
local hideEvent = script.Parent:WaitForChild("Hide")
local exitEvent = script.Parent:WaitForChild("Exit")
local playerSafeValue = player:FindFirstChild("Safe")
-----------------------------------------------------------------------------------------------
local isInLocker = false
proximityPrompt.Triggered:Connect(function(player)
if not isInLocker then
hideEvent:FireServer("1")
camera.CameraType = Enum.CameraType.Scriptable
tween3:Play()
tweenUI1:Play()
tweenLighting1:Play()
isInLocker = true
playerSafeValue = true
end
end)
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.UserInputType == Enum.UserInputType.Keyboard and not gameProcessed then
local keyPressed = input.KeyCode
if keyPressed == Enum.KeyCode.E and isInLocker then
exitEvent:FireServer("2")
camera.CameraType = Enum.CameraType.Custom
tweenUI2:Play()
tweenLighting2:Play()
isInLocker = false
playerSafeValue = false
end
end
end)
proximityPrompt.PromptShown:Connect(function()
tween1:Play()
end)
proximityPrompt.PromptHidden:Connect(function()
tween2:Play()
end)
I’ve attached a video of the issue.