Hello Developers,
I am currently working on a placing and picking up system using raycasting when the player can anchor parts to surfaces to place objects. However the problem I am encountering is that once you place it, it can’t be picked up again due to the proximityprompt not being visible. Despite it containing the proximityprompt, when it is placed, its not visible.
My only guess is that when I clone the part into the workspace, proximity prompt breaks or perhaps there is some property of the mesh that disables the proximity prompt from working.
This is the script that runs when the player places the object and clones it into the workspace:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local placeEvent = ReplicatedStorage:WaitForChild("PlaceItem")
local coalModel = ReplicatedStorage:WaitForChild("Coal")
placeEvent.OnServerEvent:Connect(function(player, cframe)
local newCoal = coalModel:Clone()
newCoal.CFrame = cframe
newCoal.Anchored = true
if newCoal:IsA("MeshPart") then
newCoal.Anchored = true
newCoal.CanCollide = true
newCoal.Transparency = 0
end
newCoal.Parent = workspace
end)