#model only plays first tween properly

1 messages · Page 1 of 1 (latest)

half rover
#

idk if its something to do with how cframe works, but it just doesn't do the other tweens properly (supposed to rotate back, forward and then back again)
also this is probably really inefficient but i dont really care that much abt it

wait(0.15)
        local swing = script.Parent.Parent.swing
        local root = plr.HumanoidRootPart
        local rootV3 = Vector3.new(root.Position.X, root.Position.Y, root.Position.Z)
        local hit = swing:Clone()
        hit.Transparency = 0
        atkCount += 1
        crab.CFrame = CFrame.lookAt(crab.Position, Vector3.new(rootV3.X, crab.Position.Y, rootV3.Z))

        local endPos = {CFrame = CFrame.new(Vector3.new(crab.Position.X, crab.Position.Y, crab.Position.Z, crab.Orientation.X, crab.Orientation.Y - 40, crab.Orientation.Z))}
        local pull = ts:Create(crab, TweenInfo.new(1, Enum.EasingStyle.Sine), endPos)
        pull:Play()
        print(endPos)
        wait(1.1)
        
        local endPos2 = {CFrame = CFrame.new(Vector3.new(crab.Position.X, crab.Position.Y, crab.Position.Z, crab.Orientation.X, crab.Orientation.Y + 40 + 135, crab.Orientation.Z))}
        local swing = ts:Create(crab, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), endPos2)
        swing:Play()
        hit.Color = Color3.fromRGB(255, 0, 0)
        hit.CanTouch = true
        print(endPos2)
        wait(0.5)
        
        hit:Destroy()
        local endPos3 = {CFrame = CFrame.new(Vector3.new(crab.Position.X, crab.Position.Y, crab.Position.Z, crab.Orientation.X, crab.Orientation.Y - 135, crab.Orientation.Z))}
        local reset = ts:Create(crab, TweenInfo.new(1, Enum.EasingStyle.Sine), endPos3)
        swing:Play()
        print(endPos3)
        wait(1)
#

new info: it just plays the exact same tween every time

#

i still dk how to fix tho