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

[SOLVED] Script wont change the Camera Offset?

Asked by
danglt 185
5 years ago
Edited 5 years ago

I have this LocalScript inside PlayerStarterScripts and when the sound plays it doesn't change the CameraOffset

wait()

local RunService = game:GetService("RunService")

local sound = game.Workspace.Sound

local offset

local playerModel = game.Players.LocalPlayer.Character

local humanoid = playerModel.Humanoid

offset = sound.PlaybackLoudness/40

RunService.RenderStepped:Connect(function()

local the_X = offset

local the_Y = offset

local vect = Vector3.new(the_X,the_Y,0)

humanoid.CameraOffset = humanoid.CameraOffset:lerp(vect,.25)

end)

Answer this question