I have a CFrame, that goes up in the air, and after that i set the position of it back to the ground, but the problem is I set the CFrame by primarypartCframe and i works, but when i put it back to the ground i only change part.Position and the rest of the model doesn’t move, so i need to combine the PrimaryPartCFrame with the position vector somehow, and i’ve trying Multiplying it and Adding it but it doesn’t work
local lookAtCFrame = CFrame.lookAt(part.Position + Vector3.new(0, -30, 0), charPos)
local modelCFrame = CFrame.fromMatrix(part.Position, lookAtCFrame.XVector, part.CFrame.YVector, lookAtCFrame.ZVector)
if distBetweenPlayer > maxDistTeleport then
modelSCP:SetPrimaryPartCFrame(modelCFrame * CFrame.Angles(0,math.pi,0) * CFrame.new(Vector3.new(1, 1, maxDistTeleport)))
else ...
^^ in the move() function
then i do:
moveSCP()
local currentHeight = getHeight()
local amountToGoDown = currentHeight - meshPart.Size.Y/2
meshPart.Position = Vector3.new(meshPart.Position.X, meshPart.Position.Y - amountToGoDown, meshPart.Position.Z)
which works but meshPart.Position = Vector3.new...
doesn’t move the whole model (i’ve tried welding it doesn’t work) so i need to combine
modelSCP:SetPrimaryPartCFrame(modelCFrame * CFrame.Angles(0,math.pi,0) * CFrame.new(Vector3.new(1, 1, maxDistTeleport)))
with the
meshPart.Position = Vector3.new(meshPart.Position.X, meshPart.Position.Y - amountToGoDown, meshPart.Position.Z)
Any help would be appreciated, for more info on code just reply