Hello! So I am using this to clone a building but if there is a block above the spawn, it will spawn ontop of the brick, how can I make it so that the building spawns inside the brick, not ontop?

x = script.Parent.Position.X
y = script.Parent.Position.Y
z = script.Parent.Position.Z

local building = game.ReplicatedStorage.Buildings.Market:Clone()
building:Clone()
building.Parent = game.Workspace
building:MoveTo( Vector3.new(x,y,z))

2 comments

0

This has been a roblox issue for awhile. To fix this, all the parts CanCollide have to be set to false. After that, it can be set back to true. You can use a pairs loop for this.

0

lol why don't you do MoveTo(script.Parent.Position)