I have had an issue for a while where when I try to spawn/clone an unanchored block from a ReplicatedStorage folder into Workspace, it cannot be pushed by your avatar in Studio play testing, but you can push it fine in game.
I posted this issue on Reddit a while back, and got an answer suggesting I use network ownership.
block:SetNetworkOwner(nil) -- Server
block:SetNetworkOwner(plr) -- The player who spawned the block
Neither of the above options worked, and now I’m kind of stumped. If you need a video or my code, ask and I can give it, but it might be a while because I’m about to go to bed. Please let me know if you have a solution!
I’m unsure of the exact issue here, so here’s two possible solutions.
1. The move tool isn’t working.
Due to recent keybind changes, ctrl + 1 no longer enables select, ctrl + 2 not move, ect.
The new keybinds are just 1, 2, 3, 4. But these don’t work in playtesting before they would override tool keybinds.
You need to go into the home tab and manually click the tool you want during playtesting.
2. The move tool is working, but the block snaps back when moved.
This means that the server is overriding the position of the block. You need to go in the home tab , and click the server-client swap button (this button only shows up in runtime), to go to the server side, then you should be able to move the block fine.
Basically, deleting or changing something in client view makes that change client side only.
Ah, okay, the block is likely too heavy then, the player doesn’t have much push force.
Try making the block’s size 2x3x2, or decreasing it’s density in the customphysicalproperties section near the bottom of the properties window.
Code snippets would be a huge help. My current theory is something to do with the player joining the server earlier then expected in studio. Stuff like .PlayerAdded can sometimes fail in studio if the game takes too long to load.
-- spawnerModel.BlockToSpawn.Value is the name of the block
local function onClick()
script["Click - Soft UI"]:Play()
local existingBlock = workspace:FindFirstChild(spawnerModel.BlockToSpawn.Value .. ID.Value)
if not existingBlock then
local clone = block:Clone()
clone.Parent = workspace
clone.Name = clone.Name .. ID.Value
clone.CFrame = spawnPos.CFrame
clone.Anchored = false
else
existingBlock:Destroy()
onClick()
end
end
Add some delays maybe that helps?
I have this issue where the game like starts yielding for no reason and glitches out. I hope this gets fixed as a bug report!
I would advise using print statements to try and figure out the following things.
Is it detecting a click?
Is it spawning a block?
Is the block unanchored?
This is an example:
-- spawnerModel.BlockToSpawn.Value is the name of the block
local function onClick()
print("click detected")
script["Click - Soft UI"]:Play()
local existingBlock = workspace:FindFirstChild(spawnerModel.BlockToSpawn.Value .. ID.Value)
if not existingBlock then
print("making new block")
local clone = block:Clone()
clone.Parent = workspace
clone.Name = clone.Name .. ID.Value
clone.CFrame = spawnPos.CFrame
clone.Anchored = false
print(clone.Anchored)
else
existingBlock:Destroy()
onClick()
end
end
There’s no such thing as too many print statements, just make sure to clean them up after!
No problem,
studio is just sometimes stupid and sometimes bugs will occur. At least key communication is placed so all of us are also aware as fellow devs!