So, I've been developing a fire pit tool, which will make a clone of the fire pit inside local camera when equipped:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local object = game.ReplicatedStorage.InteractableTool[script.Parent.Name]
event = game.ReplicatedStorage.RemoteEvent
script.Parent.Equipped:Connect(function()
local invisible = object:Clone()
invisible.Parent = workspace.CurrentCamera
invisible.CFrame = mouse.Hit
invisible.UsePartColor = true
invisible.CanCollide = false
invisible.Fire.Enabled = false
mouse.TargetFilter = invisible
mouse.Move:Connect(function()
invisible.CFrame = mouse.Hit + Vector3.new(0,1,0)
invisible.Orientation = Vector3.new(0,0,0)
script.Parent.Activated:Connect(function()
invisible:Destroy()
event:FireServer(mouse.Hit, object)
script.Parent:Destroy()
end)
script.Parent.Unequipped:Connect(function()
invisible:Destroy()
end)
end)
end)
it's like a building method, you know, for player to position the object. On click, it would spawn the real firepit to the workspace. But the problem is, if there is a wall blocking the fire pit, its CFrame would be INSIDE the wall, which sounds ridiculous. How to solve this??? please :< Thanks a lot! ~~
