[CODE]for k, v in pairs( ents.GetAll() ) do
if v:GetName() == "ag_fire_a" then
print(v:OBBMins())
end
end[/CODE]
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 [URL="http://wiki.garrysmod.com/page/PhysObj/GetAABB"]GetAABB[/URL]
[code]Mins,Maxs = E:GetPhysicsObject():GetAABB()[/code]
[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.
[img]http://puu.sh/fLcZD/28697c2624.png[/img]
[img]http://puu.sh/fLd5V/47f88fdb58.png[/img]
[img]http://puu.sh/fLdhR/56f65f5700.png[/img]
[img]http://puu.sh/fLdnl/704fce8fdb.png[/img]
[QUOTE=Pandaman09;47117270]If you cannot get the OBB to work properly, you could always get the entity's physics object and use [URL="http://wiki.garrysmod.com/page/PhysObj/GetAABB"]GetAABB[/URL]
[code]Mins,Maxs = E:GetPhysicsObject():GetAABB()[/code]
[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.
[img]http://puu.sh/fLcZD/28697c2624.png[/img]
[img]http://puu.sh/fLd5V/47f88fdb58.png[/img]
[img]http://puu.sh/fLdhR/56f65f5700.png[/img]
[img]http://puu.sh/fLdnl/704fce8fdb.png[/img][/QUOTE]
It's always tell me
[CODE]Tried to use invalid object (type IPhysicsObject) (Object was NULL or not of the right type)
[/CODE]
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.
[QUOTE=bitches;47117857]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.[/QUOTE]
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 [URL=http://wiki.garrysmod.com/page/PhysObj/GetAABB]GetAABB[/URL].
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.
[QUOTE=Acecool;47122299]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.[/QUOTE]
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..
Sorry, you need to Log In to post a reply to this thread.