I have hit an issue I can’t find a solution for, I want to unanchor a part in a localscript to make it fall when the player hits it for the local player only to see so each player has to do.
I have read that unanchoring a part on a localscript will not do anything untill a force is applied to it or player gets close and setting the network owner is not the answer.
Has anyone had this sort of issue before and what is the best solution if any?
I ran into a similar issue with obby physics. I found out the client should still simulate any locally cloned/created parts so maybe try cloning it on the client and unanchoring the clone.
For example you have a RemoteEvent in replicated storage
So here’s how scripts will look.
Normal Script (into the part you want to fall)
local deb = false
local RemoteEvent = game:GetService("ReplicatedStorage").RemoteEvent -- Put your remote event name instead of "RemoteEvent"
local deb = false
local RemoteEvent = game:GetService("ReplicatedStorage").RemoteEvent -- Put your remote event name instead of "RemoteEvent"
script.Parent.Touched:Connect(function(hit)
local plr = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if plr and deb == false then
deb = true
RemoteEvent:FireClient(plr)
wait(1)
deb = false
end
end)
LocalScript (Into StarterPlayerScripts)
local RemoteEvent = game:GetService("ReplicatedStorage").RemoteEvent -- Put your remote event name instead of "RemoteEvent"
local PartToFall = game:GetService("Workspace").PartToFall -- Put your part name instead of "PartToFall"
RemoteEvent.OnClientEvent:Connect(function(plr)
PartToFall.Anchored = false
end)