#What's the most efficient way to get all
1 messages · Page 1 of 1 (latest)
Well, right now it's a box collider but if there's a better way to define an area for this purpose I'm all ears
I'm mostly interested in what you call an area. An area can be a whole town, or a 5m² region.
Do Physics Actors enter and exit the Area?
YES that's the key point
In theory you will probably want to have an Array of PhysicsActors that you maintain
A boxCollider can be used via Overlap events (Begin and End)
To add them to an array
Overlap is a good idea
Ultimately, you want to update that list only when a new element is actually added/removed, instead of figuring out what is in it every frame.
The idea here is to simulate gravity to throw all objects in a room in a certain direction. in THEORY this should be for an entire building-sized area, but actually I'll probably subdivide the building so later rooms aren't a mess when the player is there
You can loop the list every frame fwiw
Yeah, try to be reasonable with that stuff. Rooms the player isn't in aren't technically needed to update, or at least not every frame