This may be hard to explain but basically i have this script that has a part teleport behind a player when it is not looked at, it works however when it teleports it is just floating in the air and isn’t falling to the ground like a unachored part is supposed to behave
Script (local):
local player = game.Players.LocalPlayer
local camera = game.Workspace.CurrentCamera
local teleportInterval = 5
Cone.Anchored = false -- Unanchor the cone
while true do
local cameraPosition = camera.CFrame.Position
local playerCharacter = player.Character
if playerCharacter then
local torso = playerCharacter:FindFirstChild("Torso") or playerCharacter:FindFirstChild("UpperTorso") or playerCharacter:FindFirstChild("HumanoidRootPart")
if torso then
local torsoPosition = torso.Position
local direction = (Cone.Position - cameraPosition).unit
local cameraLook = camera.CFrame.LookVector
local dotProduct = direction:Dot(cameraLook)
print("Dot Product:", dotProduct)
if dotProduct < 0 then
-- Cone is not visible to the camera
print("Cone not visible to the camera")
local behindPosition = torsoPosition - torso.CFrame.LookVector * 10 -- Teleport behind the player's torso
Cone.CFrame = CFrame.new(behindPosition)
end
end
end
wait(teleportInterval)
end