Author Topic: Container Searches  (Read 1048 times)

Does a container search only detect an object if it is fully inside the container or just a part of it?

Just part of it, i'm pretty sure.

You could be smart and work out the objects size somehow then do another container search smaller by half the size or something to detect when an object is completely inside, however i have no idea how to get any objects size.

Any object that is partly inside is counted. However you can use object.getWorldBox to, obviously, get it's world box, and then use math to figure out whether it's completely in your search box.

I recall getWorldBox never working as I expected for some reason, although I don't remember why. Any pointers on using it?

I recall getWorldBox never working as I expected for some reason, although I don't remember why. Any pointers on using it?

It's really broken for players, but otherwise it's fine.

Ah, that would explain it then. Thanks.

Keep in mind sometimes the size you expect it to be is kinda goofy.

For example, I remember multiple cases where a box size of 2 would give me objects I would think to be just outside the search, and a size of 1.9999 giving the expected results.

Exactly what I needed to know, thanks.  Just wanted to find out if there was a simpler way before I started working out a equation lol.