Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a tween continue forever in it's direction until updated?

Asked by 4 years ago

So i have this code, This tween's the camera to the mouse's position smoothly, But once the tween hit's it's destination it all the sudden stop's, I don't want that because it make's it feel weird, So basically i want it to continue in the cframe direction forever until updated, I've tried doing something like ((Cursor.Hit.p.X + math.huge)) but it just glitches the camera out, Thank's.

local part = workspace:WaitForChild("cam")
local Player = game:GetService("Players").LocalPlayer
local Cursor = Player:GetMouse()
local cam = workspace.CurrentCamera

Cursor.Move:Connect(function()
cam.CameraSubject = Cursor
cam.CameraType = Enum.CameraType.Scriptable
local t = ts:Create(cam,TweenInfo.new(0.5,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0),
{CFrame = CFrame.new(part.Position,Vector3.new(Cursor.Hit.p.X,part.Position.Y,Cursor.Hit.p.Z))}):Play()
end)
0
Don't think you should be using a tween for this. Instead maybe cframe the camera's position in a while loop? royaltoe 5144 — 4y
0
if you're using linear then just add a vector3 to the current cframe, no reason to use something like tweenservice Fifkee 2017 — 4y

Answer this question