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

please help me with this error and can it be fixed? attempt to index nil with 'Position'

Asked by 3 years ago
Edited 3 years ago

`i am trying to make an orb for my game but this keeps coming up i don't know what it means and how i can fix it? Here is the code please tell me if i need to add any more of my code

newOrb:MoveTo(game.Workspace.OrbSpawnLocations:FindFirstChild(spawnLocStr).Posi
tion)

the second line is spose to be part of the first i just didn't have space

1 answer

Log in to vote
0
Answered by 3 years ago

the game is not finding the child called spawnLocStr cuz the game may responded with no cuz that child has not been loaded yet , so consider changing FindFirstChild() to WaitForChild()

0
now it says: Infinite yield possible on 'Workspace.OrbSpawnLocations:WaitForChild("SpawnLoc15")' is this good? Note_23322 16 — 3y
0
wait djabdou33 40 — 3y
0
make sure that the name is right and that this spawn location really exist djabdou33 40 — 3y
0
ok thank you Note_23322 16 — 3y
View all comments (2 more)
0
does this site answer non out put errors? Note_23322 16 — 3y
0
idk djabdou33 40 — 3y
Ad

Answer this question