this is a first for me. my LocalScript only prints “script running” but never anything else. it doesn’t throw any errors, no “Infinite yield”, nothing. i haven’t the slightest clue as to what the issue could be
print("script running")
local viewport = script.Parent:WaitForChild("ViewportFrame")
local world_model = viewport:WaitForChild("WorldModel")
local local_player = game:GetService("Players").LocalPlayer
local character = local_player.CharacterAdded:Wait() or local_player.Character
local connection
print("starting viewport frame") -- never prints ???
viewport.CurrentCamera = workspace.CurrentCamera
if world_model and world_model.Rig then
print("the stuff is not nil")
connection = game:GetService("RunService").RenderStepped:Connect(function()
if world_model.Rig.PivotTo then
print("PivotTo function exists")
world_model.Rig:PivotTo(workspace.CurrentCamera.CFrame)
print("pivoted")
else
warn("not a valid function")
end
end)
else
warn("something malicious is brewing (something is nil)")
end
i can’t find an obvious error either; but, try switching .CharacterAdded:Wait() and .Character around? maybe the script is forced to wait for some reason
When this scipt runs in the first milleseconds it takes during loading your WaitForChilds may time out and not find the items so the script gets hung up.
Try prints after each of your local lines at the top to see where it’s hanging up:
local viewport = script.Parent:WaitForChild("ViewportFrame")
print(viewport) -- or viewport.Name if necessary, I'm not familiar with all the properties)
local world_model = viewport:WaitForChild("WorldModel")
print(world_model) -- or world_model.Name
--etc.
update: turns out it was the character portion that stopped the script from running. i placed print statements between each variable declaration and it stopped at “print(character)”. i removed it and it worked exactly as intended