Objects rises forever instead of descending

Hi,


Code Snippet
--[[
    CollRotationPoint is just the Rotation Value of when the object
    spins, there is no problem with it
--]]
CollRotationPoint = (CollRotationPoint + dt*45) % 360
for _,i in CollectionService:GetTagged("Collectable") do
	local y = math.sin(os.clock()*2)
    -- math.sin usage, multiplied by 2 to increase its speed
	local Normal = y + (i.Size.Y/2 + 1)
    -- This is to prevent the Object from Clipping through the floor
    -- when math.sin is active
	local NormalVector = Vector3.new(0, Normal, 0)
    -- Creates a Vector
	
    local Pos = CFrame.new(i.Position + NormalVector)
    local Rot = CFrame.Angles(0, math.rad(CollRotationPoint), 0)
    -- Creates CFrame for use
	i.CFrame = Pos * Rot
    -- Applies CFrame
    -- When Adding (OriginalPosition + OffsetPosition)
    -- instead of it moving relative to its location
    -- it instead rises forever without stopping
end

How can I fix this? It has been an issue for quite some time now.

I Appeared to have fixed the issue, I turns out I was accidentally Setting the Current Position instead of the Original Position, which caused it to fly.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.