-
What do you want to achieve? I want to have my ProximityPrompt with LineOfSight off not be dependent on the camera, but on the character.
-
What is the issue? Even with this value turned off, my frame still disappears when the camera moves away.
-
What solutions have you tried so far? I’ve looked online, and found nothing. I’ve optimized my code to prevent opening and closing tweens from pausing the main execution thread.
LocalScript
--Services
local TweenService = game:GetService("TweenService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
--Modules
local mainModule = require(ReplicatedStorage:WaitForChild("MainModule"))
--Make GUI appear when close
for _, gameTable in pairs(game.Workspace.Tables:GetChildren()) do
if gameTable:IsA("Model") then
local mainTablePart = gameTable:FindFirstChild("MainTable")
local billboard = mainTablePart:FindFirstChild("BillboardGui")
local prompt = mainTablePart.ProximityPrompt
prompt.PromptShown:Connect(function()
billboard.Size = UDim2.new(0,0,0,0)
billboard.Enabled = true
mainModule.tween(billboard,TweenInfo.new(.5,Enum.EasingStyle.Back),{Size=UDim2.new(10,0,7.5,0)})
end)
prompt.PromptHidden:Connect(function()
local function tweenComplete()
billboard.Enabled = false
end
mainModule.tween(billboard,TweenInfo.new(.5,Enum.EasingStyle.Back),{Size=UDim2.new(0,0,0,0)},tweenComplete)
end)
end
end
ModuleScript
--Services
local TweenService = game:GetService("TweenService")
local module = {}
module.tween = function(instance,tweenInfo,propertyTable,tweenCompleteFunction)
local tweenTask = function()
local tween = TweenService:Create(instance,tweenInfo,propertyTable)
tween:Play()
tween.Completed:Wait()
if tweenCompleteFunction then
tweenCompleteFunction()
end
end
task.spawn(tweenTask)
end
return module
(There is no Server Script interacting with this ProximityPrompt in any way)
Space Game Pre-Release.rbxl (50.9 KB)
Also, sorry, I couldn’t really figure out where to put this. Both Scripting Support and Building Support sounded appropriate, but I feel this may be based on my code.
If there is no way to fix this, and I should just not use ProximityPrompts, please let me know
Thanks, hope someone can help!