I want it so when I unachor the model falls to the ground where it was above. I tween a model to a position, and when it is completed, the script unachored it. When it becomes unanchored, it teleports back to its original spawn point. The only part that is anchored is the primary part. I tried setting its CFrame to the part that is at its final position, but it did nothing.
We need the code to figure out what you’re doing. It sounds like you’re setting it’s Position to 0,0,0 after the tween.
Remember to put 3 backticks (```) before and after your script when you copy/paste it here so it formats correctly.
local traveltime = math.round((distance / 10) * 5) / 10
local goal = {}
goal.Position = target.PrimaryPart.Position
local tweenInfo = TweenInfo.new(traveltime, Enum.EasingStyle.Quad,Enum.EasingDirection.Out)
local tween = TweenService:Create(model.PrimaryPart, tweenInfo, goal)
local modelPos = model.PrimaryPart.Position
local targetPos = target.PrimaryPart.Position
local lookCFrame = CFrame.new(modelPos, targetPos)
model:SetPrimaryPartCFrame(lookCFrame)
tween:Play()
tween.Completed:Connect(function(playbackState)
if playbackState == Enum.PlaybackState.Completed then
model.PrimaryPart.Anchored = false
end
end)
Found it. It was a model problem. Not sure why, though. It was motor6D.