Hey! I’m writing to ask for some scripting support
I’m trying to figure out how to get a parts position when it touches the ground it spawns in shards and for some reason I can’t figure out how to spawn the shards to the position to where the part fell
I can’t change the position of the clone in workspace
hello
the reason you cant change the position of the shards in the workspace is because the shards are a model, which need to be moved with the :PivotTo() function.
if you are want something simple, you can just get the position of the teapot (Teapot.Position) and then iterate over the teapot shards in a for loop.
you can
so something like:
local function shatterTeapot()
local shardClone = shards:Clone()
for _, shard in pairs(shardClone:GetChildren()) do
if shard:IsA("BasePart") then
shard.Position = Teapot.Position
end
end
end
you could also do
shard:ApplyImpulse(Vector3.new(0, 5, 0)) -- Make higher to make impulse stronger
to make the shards go up in the air after shattering