Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to check if an object is near me?

I'm well aware of how magnitude works, however I find it's use highly impractical in this case. I have a huge game I'm working on, consisting of many objects. So iterating the entire workspace and everything inside it every fraction of a second or so to check the magnitude between the player and the object, seems excruciatingly memory intensive (not to mention the very noticeable lag that comes with it).


So basically my question is, is there any way to find out if a object is near your character, without constantly iterating the entire world? Maybe Ray Casting is an option? Sorry I don't have any code to provide, I'm just very unsure of how I'd go about this.


Thanks for reading, if you have any insight on how I could go about doing this, I sure would appreciate it!

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.