hey so i'm just gonna solve this by commenting on/editing your code because i'm big lazy
local debounce = false
local root = script.Parent.Bottom
script.Parent.PrimaryPart = root
while wait() do
local rootPos = root.Position
if rootPos.Y > -11.471 and not debounce then
debounce = true
print("no fly")
local dir = root.CFrame.LookVector
root.Anchored = true
root.CFrame = CFrame.new(rootPos.X, -11.471, rootPos.Z) * CFrame.Angles(0, -math.asin(dir.X), 0)
root.Anchored = false
wait()
debounce = false
end
end
i think a lot of the stuff here is just like, you trying to troubleshoot without knowing exactly what's happening so i get it.
so essentially, you have two options i think, even though i'm not entirely sure what you're trying to do.
local root = script.Parent.Bottom
script.Parent.PrimaryPart = root
local dir = root.CFrame.LookVector
while wait() do
local rootPos = root.Position
if rootPos.Y > -11.471 then
print("no fly")
root.CFrame = CFrame.new(rootPos.X, -11.471, rootPos.Z) * CFrame.Angles(0, -math.asin(dir.X), 0)
end
end
so this one should root it to one CFrame, then base the CFrame.Angles() that you multiply it by off of one LookVector that won't be changed.
if you're just trying to set it to that specific Y coordinate and not change its rotation at all, then you could do . . .
local root = script.Parent.Bottom
script.Parent.PrimaryPart = root
while wait() do
local rootPos = root.Position
if rootPos.Y > -11.471 then
print("no fly")
root.CFrame = root.CFrame + Vector3.new(0,-(root.Position.Y+11.471),0)
end
end
which will essentially just take its current position on the Y-axis, add the offset that you want to it, and subtract it from its current position