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

How does Apeirophobia Flashlight Gui move with the player Movements?

Asked by
Puppynniko 1059 Moderation Voter
2 years ago
Edited 2 years ago

i already have a script for following the mouse in first person but i have no idea on how to make it move with the players Movements

it uses this lines to move it from the mouse like sway

TS:Create(Light,TI,{Position = UDim2.new(.5,-delta.X*Offset,.5,-delta.Y*Offset)}):Play()

i can probrobly use this function to do it but i dont know what are the values that i need to apply

function updateBobbleEffect()
    local currentTime = tick()
    if humanoid.MoveDirection.Magnitude > 0 then
        local bobbleX = math.cos(currentTime * 7) * .20
        local bobbleY = math.abs(math.sin(currentTime * 7)) * .20        
        local bobble = Vector3.new(bobbleX, bobbleY, 0)
        humanoid.CameraOffset = humanoid.CameraOffset:lerp(bobble, .25)
    elseif humanoid.MoveDirection.Magnitude == 0 then
        local bobbleY = math.abs(math.sin(currentTime * 1.6)) * .20        
        local bobble = Vector3.new(0, bobbleY, 0)
        humanoid.CameraOffset = humanoid.CameraOffset:lerp(bobble, .15)

    else 
        humanoid.CameraOffset = humanoid.CameraOffset * .75
    end
end

Answer this question