I am trying to create custom forcefields, however it’s causing players to be unable to walk on spawn (even tho Anchored is set to false ) so I tried setting the network owner, however I get this error saying it needs to be a descendant of workspace (which the character is)
Can only call Network Ownership API on a part that is descendent of Workspace
--// Create forcefield for character
local function CreateForceField(player, character)
character:SetAttribute("ForceField", true)
local ForceFieldClone = ForceField:Clone()
ForceFieldClone.CFrame = character.HumanoidRootPart.CFrame
local WeldConstraint = Instance.new("WeldConstraint")
WeldConstraint.Part0 = ForceFieldClone
WeldConstraint.Part1 = character.HumanoidRootPart
WeldConstraint.Parent = ForceFieldClone
ForceFieldClone.Parent = character
ForceFieldClone:SetNetworkOwner(player) -- Set network owner to prevent being stuck on spawn
delay(Settings.FORCEFIELD_TIME, function()
ForceFieldClone:Destroy()
character:SetAttribute("ForceField", false)
end)
end