When ever i move a model with a script I made:
mainpart.CFrame = character.Head.CFrame+cameralook.LookVector*10
mainpart.Orientation = mainpart.Orientation + rotation
mainpart.Anchored = true
it makes the model spin around for some reason and I can’t
figure out why
Example:
the table(model welded to primary part with motord6) is meant to move like the chair(part/union) but instead it just spins around
does anyone know why?
Local:
runservice.RenderStepped:Connect(function()
if currentprop ~= nil then
if currentprop:IsA("Model") then
currentprop.PrimaryPart.CFrame = character.Head.CFrame+workspace.CurrentCamera.CFrame.LookVector*10
currentprop.PrimaryPart.Orientation = currentprop.PrimaryPart.Orientation + currentrotation
else
currentprop.CFrame = character.Head.CFrame+workspace.CurrentCamera.CFrame.LookVector*10
currentprop.Orientation = currentprop.Orientation + currentrotation
end
updatepropevent:FireServer(currentprop,"Carry",workspace.CurrentCamera.CFrame,currentrotation)
end
end)
Server:
if action == "Carry" then
mainpart.CFrame = character.Head.CFrame+cameralook.LookVector*10
mainpart.Orientation = mainpart.Orientation + rotation
mainpart.Anchored = true
if prop:IsA("Model") and not prop:FindFirstChild("col",true) then
for _,i in pairs(prop:GetDescendants()) do
if i:IsA("BasePart") then
local originalcollide = Instance.new("BoolValue")
originalcollide.Value = i.CanCollide
originalcollide.Parent = i
originalcollide.Name = "col"
local originalquery = Instance.new("BoolValue")
originalquery.Value = i.CanQuery
originalquery.Parent = i
originalquery.Name = "que"
i.CanCollide = false
i.CanQuery = false
end
end
elseif prop:IsA("BasePart") and mainpart.CanCollide ~= false then
mainpart.CanCollide = false
mainpart.CanQuery = false
end
elseif -- yada yada yada unrelated code stuff