Attempt to index with nil 'position'

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
  • I want to get rid of a error message spamming my output.
  1. What is the issue?
  • I am getting the error that my position for the primary part is nil, I believe it is because of the models not loading in, is there a simple fix to that?

the error is on the 2nd line.

runService.RenderStepped:Connect(function()
			if player:DistanceFromCharacter(v:WaitForChild("EggMesh").PrimaryPart.Position) <  MaxDisplayDistance then
				if cantOpenBillboard == false then
					billboardTemp.Enabled = true
					animateBillboard(billboardTemp,true)


picture of my ugly output due to this error. NOTE : this just started happening because my map has gotten bigger! which makes me believe its a loading in issue, is there a fix?

1 Like

is the primary part set in the model?

Yes, all models have a set primary part.

1 Like

image

1 Like

probably streamingenabled then: Instance Streaming | Documentation - Roblox Creator Hub

basically, the models themselves load in if the player is in the set radius but the parts inside dont load in until you get close enough

EDIT: thats default/legacy, improved doesnt load the models in when you join

2 Likes

Your code is unclear, what you want to do? what type of script or function? give us more details

1 Like

That is exactly what I needed to do! Wow had no clue that was a thing very helpful. Thank you so much!

2 Likes

no worries, could you set my reply as the solution? :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.