Hello, I am making a construction system but when building the structures they stack up for no reason, is it due to some type of configuration?
this is the code:
local run; run = RUN.RenderStepped:Connect(function()
local pos = Vector3.new(math.floor(mouse.Hit.Position.X / grid) * grid, math.floor(mouse.Hit.Position.Y), math.floor(mouse.Hit.Position.Z / grid ) * grid)
print(pos)
obj:MoveTo(pos)
end)
1 Like
What does this code print out?
Scottifly
(Scottifly)
#3
Pretty sure it’s because you are using MoveTo. That’s meant for models so they don’t end up inside other items.
Just CFrame it to pos
.
1 Like
Thanks for your help, now I have to solve a new problem, the objects appear with an orientation of 0,0,0
If someone had the same question, the solution is to use PivotTo()
Scottifly
(Scottifly)
#5
Read the MoveTo link. If you need the orientation kept the same it says to use TranslateBy() or PVInstance:PivotTo()
1 Like
system
(system)
Closed
#6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.