So I have a mini map, But it should work, But for some reason in the output its saying that HumanoidRootPart isn't a valid member of Character? Here is the Local script:
local CircularMap = game.ReplicatedStorage.CircularMap CircularMap.Parent = workspace local FakeCam = Instance.new("Camera") FakeCam.Parent = script.Parent FakeCam.CameraType = Enum.CameraType.Scriptable script.Parent.Adornee = CircularMap.PrimaryPart script.Parent.ViewportFrame.CurrentCamera = FakeCam workspace.Map:Clone().Parent = script.Parent.ViewportFrame while true do CircularMap:SetPrimaryPartCFrame(workspace.CurrentCamera.CFrame*CFrame.Angles(math.rad(90),0,0)*CFrame.new(-10,-10,-3)) FakeCam.CFrame = CFrame.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position + Vector3.new(0,10,0), game.Players.LocalPlayer.Character.HumanoidRootPart.Position) game:GetService("RunService").RenderStepped:Wait() end
Also, if you wondering where i says HumanoidRootPart is on line 14, Thanks.
An easy way to fix this problem is to listen for the character until it loads in:
game.Players.LocalPlayer.CharacterAdded:Wait()
You can then check to see if the HumanoidRootPart
exists:
if game.Players.LocalPlayer.Character.HumanoidRootPart then
An easy but pretty good solution to your problem.
I often had this same problem with the humanoid. I think the problem is that the player loads before the character does. So just add a line to wait until the character loads to run your script:
repeat wait() until game.players.localplayer.character ~= nil and game.players.localplayer.character:FindFirstChild("HumanoidRootPart") ~= nil