Hey there!
I have a problem, and I'm not sure how to word it exactly, but I will try my best. I have a client side prop and I'm trying to get it to detect when it is colliding with another prop. My solution seemed logical; I simply put the client props collision bounds as the mins and max for the FindInBox, but I can not seem to get any results. My PrintTable() call prints nothing, and I just don't see the flaw in my logic. The only thing I can think of is the boxes location, but wouldn't it follow the client prop? I don't know. If you need more information, let me know!
PrintTable(ents.FindInBox(clientprop:GetCollisionBounds()))
The problem is Entity/GetCollisionBounds returns local coordinate space. You want world-space coordinates.
local mins, maxs = ent:GetCollisionBounds()
mins = ent:LocalToWorld(mins)
maxs = ent:LocalToWorld(maxs)
PrintTable(ents.FindInBox(mins, maxs))
Your solution worked perfectly. However, I want to know a little bit more about the rotating problem, what exactly do you mean? And what does AABB even stand for?
Axis-Aligned Bounding Box, which means it does not rotate. The Outer Bounding Box of an entity rotates but you cannot rotate ents.FindInBox.
Sorry, you need to Log In to post a reply to this thread.