Can't get OBBMins or OBBMaxs


for k, v in pairs( ents.GetAll() ) do
	if v:GetName() == "ag_fire_a" then
		print(v:OBBMins())
	end
end

It’s always 0 0 0

why? Please help me

This is the point where you start debugging IF you haven’t already, if you have, disregard the rest of this message. Start printing out the class name, do logical checks, do anything that might help you find out what’s wrong.

If you cannot get the OBB to work properly, you could always get the entity’s physics object and use GetAABB


Mins,Maxs = E:GetPhysicsObject():GetAABB()

[del]AABB MAY return the local or global positions, not sure.[/del] AABB returns a local value like OBB

EDIT: did some testing and found some interesting results. These are all on the server state.

http://puu.sh/fLcZD/28697c2624.png

http://puu.sh/fLd5V/47f88fdb58.png

http://puu.sh/fLdhR/56f65f5700.png

http://puu.sh/fLdnl/704fce8fdb.png

It’s always tell me


Tried to use invalid object (type IPhysicsObject) (Object was NULL or not of the right type)


Is this fire entity a point entity? Something that has no physics and instead just 2d effects and an area of effect? I doubt those would have proper OBB.

No, this Entity has no physics

Is there other way??

What are you trying to accomplish?

I don’t think there’s another way other than GetAABB.

There is another way… There’s an issue with ClientsideModels sometime not showing Mins/Maxs in DModelPanel. In order to “enable” them you need to first set the model as something from TF2 ( like the teleporter model ) before changing it to the model you want.

It’s how I get the center of a model in my DModelPanel…

“models/buildables/teleporter.mdl”

Since it works on ClientsideModels in DModelPanel, I see no reason why it wouldn’t work on other models.

Nobody said anything about clienside models, unless you happen to know what ag_fire_a is. It sounds to me like a point entity.

You may be right… I assumed because the op was trying to use OBB functions … and others posted about it so I just wanted to share one of the reasons of how the functions could report 0 0 0 instead of the actual size.

If it is a point entity then something else could be done… Ie the fire system should be able to know how large a fire is via adding / subtracting the size…