demiena
(demiena)
January 29, 2020, 11:03pm
#1
if Water ~= nil then
FisheyeEffectAlpha = FisheyeEffectAlpha + deltaTime / FisheyeEffectCycleDuration
FisheyeEffectAlpha = FisheyeEffectAlpha - math.floor(FisheyeEffectAlpha)
humCamOffset = humCamOffset + Vector3.new(math.sin(tick() * 3) * 0.2, math.sin(tick() * 3.21) * 0.2, math.sin(tick() * 3.73) * 0.2)+ Vector3.new(math.sin(tick() * 3) * 0.2, math.sin(tick() * 3.21) * 0.2, math.sin(tick() * 3.73) * 0.2)
local camoffs = humCamOffset + Vector3.new(math.sin(tick() * 3) * 0.2, math.sin(tick() * 3.21) * 0.2, math.sin(tick() * 3.73) * 0.2)+ Vector3.new(math.sin(tick() * 3) * 0.2, math.sin(tick() * 3.21) * 0.2, math.sin(tick() * 3.73) * 0.2)
player.Humanoid.CameraOffset = camoffs
end
end)
This did not work. I tried doing everything. Please help
2 Likes
demiena
(demiena)
January 29, 2020, 11:09pm
#2
It says attempt to index nil with âHumanoidâ on line 6.
28Y8
(onses)
January 29, 2020, 11:14pm
#3
Try to do:
player.Character:WaitForChild("Humanoid").CameraOffset = camoffs
demiena
(demiena)
January 31, 2020, 12:54am
#4
And now it gives me attempt to index nil with âWaitForChildâ
Apicphis
(Apicphis)
January 31, 2020, 1:25am
#6
Try this line of code:
player:WaitForChild(âHumanoidâ).CameraOffset = camoffs
The issue is, the player object doesnât have a Humanoid inside it, their Character does. Try replacing that with this:
if player.Character then
--Make sure they have a character.
player.Character:WaitForChild("Humanoid").CameraOffset = camoffs
If it doesnât work, it likely means you havenât stored the actual player object in variable player
.
(Or itâs that I just woke up and am on my phone lol)
demiena
(demiena)
January 31, 2020, 1:46am
#8
also, when i messed up my code, it gave me bad argument #1 (Vector3 expected, got nil)
demiena
(demiena)
January 31, 2020, 1:51am
#9
if Water ~= nil then
humCamOffset = humCamOffset + Vector3.new(math.sin(tick() * 3) * 0.2, math.sin(tick() * 3.21) * 0.2, math.sin(tick() * 3.73) * 0.2)+ Vector3.new(math.sin(tick() * 3) * 0.2, math.sin(tick() * 3.21) * 0.2, math.sin(tick() * 3.73) * 0.2)
if player.Character then
--Make sure they have a character.
player.Character:WaitForChild("Humanoid").CameraOffset = humCamOffset
this is my code
demiena
(demiena)
January 31, 2020, 1:52am
#10
on the 2nd line. i donât know why.
kisty1
(Kisty)
January 31, 2020, 2:10am
#11
humCamOffset is nil, initialize it with an empty Vector3 where itâs being defined