This script is moving a box, full of unanchored cubes, and the box keeps going all sijnhfdibdsfi, and not staying upright. How do I make the box stay upright?
local ts = game:GetService("TweenService")
local p1 = script.Parent.Parent.rollmove.RI
local p2 = script.Parent.Parent.rollmove.RII
local box = script.Parent.Parent.rollmove.Box
local click = script.Parent.ClickDetector
local function roll()
script.Parent.SurfaceGui.Rolling.Visible = true
script.Parent.SurfaceGui.Roll.Visible = false
wait()
local function moveItem(item, wp)
local ti = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
local tween = ts:Create(item, ti, { Position = wp.Position})
tween:Play()
wait(2)
end
moveItem(box, p1)
moveItem(box, p2)
local tragetcframe = CFrame.Angles(0,math.rad(90),0)
box.CFrame = tragetcframe
moveItem(box, p1)
script.Parent.SurfaceGui.Rolling.Visible = false
script.Parent.SurfaceGui.Roll.Visible = true
end
click.MouseClick:Connect(roll)
If you can, can you tell me how to rotate the box upsidown so i can pour the cubes? (which are dice lol)

8 comments
Is the box unanchored?
Ok so anchor the box and put the below code in a script
The script goes in workspace
And if my answer fix the problem, please mark it as answered
the dice arent staying in the box when it moves, is there a way to fix that?
also, the box is being sent to the middle of the baseplate with ur extra script?? it didnt turn also? im also trying to make it so it only turns when it gets to p2 in the tween
oh k
If that is the case use orientation and vector3