FL Studio drag animation

How would i make something similar to the fl studio drag and drop animation like so

ive tried using a bunch of math like atan2 and found a slerp function somewhere but neither of them worked, do i suck at math or is it really that hard

2 Likes

Can you show your script with atan2? This function will be very useful for determining the angle of a vector. Basically you would get the difference between your mouse and the gui object and atan2 will tell you the angle of their difference.

local mouse: Vector2
local guiPosition: Vector2

local difference = mouse - guiPosition
local guiRotation = math.deg( math.atan2(difference.y, difference.x) )

i deleted the script with the atan2 but it was similar to this with the whole difference thing, problem is its a 3d model but like 2d, so my camera just adjusts to a menu and stands there still, something like this https://cdn.discordapp.com/attachments/942490288419655781/1152597417749905418/2023-09-16_15-29-51.mp4

Okay i managed to do it, heres the code for someone in the future who stumbled upon this thread

game:GetService("TweenService"):Create(workspace.Hand,TweenInfo.new(0.5,Enum.EasingStyle.Sine),{Position = (workspace.CurrentCamera.CFrame.Position + game:GetService("Players").LocalPlayer:GetMouse().UnitRay.Direction * 20) - Vector3.new(-1.8,5,0)}):Play()
local difference = (mouseposition - workspace.Hand.Position.X)*2.5 + 245
workspace.Hand.Orientation = Vector3.new(math.clamp(difference,-30,30),90,0)

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