#how to check if cframe lerp has completed?

1 messages · Page 1 of 1 (latest)

vernal citrus
#

self.aimcf = self.aimcf:Lerp(targetcf, dt * 10)
-- check here if the lerp has completedupvote

ashen belfry
#

Make a if statement so like
if Num =< Numyouwant then

#

= actually

vernal citrus
#

huh?

#

wdym

vernal citrus
#

ill give it a try tomorrow

heavy tulip
#

does this work? self.aimcf = self.aimcf:Lerp(targetcf, dt * 10):Wait()

vernal citrus
heavy tulip
heavy tulip
red rapids
vernal citrus
#

nvm i just made my own tween-style CFrame lerp that can be canceled

local startTime = os.clock()
    self._aimLerpCon = self.janitor:Add(RunService.RenderStepped:Connect(function(deltaTime: number)
        local alpha = math.clamp((os.clock() - startTime) / (deltaTime * 15), 0, 1)
        local interp = self.aimCF:Lerp(self.aim, alpha)
        self.aimCF = interp

        if alpha >= 1 then
            self.janitor:Remove("AimLerpConnection")
            self._aimLerpCon:Disconnect()
            self._aimLerpCon = nil
        end
    end), "Disconnect", "AimLerpConnection")