Make egg only hatch if within distance

I’m making a simulator, however I never had eggs. I made the eggs, but how would I make sure they’re close enough to the egg to open it? I don’t want them being able to open them half way across the map.

Are you using a BillboardGui ?

if yes then you can set a max distance in the property

Maybe try Proximity Prompts.

Exploiters can simply fire the remote, that’s what I want to avoid. I have the max stud view at 30.

if (Egg.Position - Player.Character.HumanoidRootPart.Position).magnitude <= 10 then

The following line checks the eggs position in relation to the characters humanoidRootPart position. Playing with the 10, which is the magnitude allows you to set how far away they should be.

Would that be stud count? If so, that’ll be so helpful. Thanks!

It isn’t exactly stud count, however as a general rule of thumb is it’s the approx. distance between the origins of the two parts.

Alright, thank you very much. Will keep this in mind!

1 Like

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