• SetModelScale changes OBB but not hulls
    4 replies, posted
So if you use SetModelScale on a player it will also scale their OBB - but not their hull for running in to walls and props. If you use SetModelScale and set your hull then your OBB will be scale^2 * hull. End result is small model scales having super small OBBs for player-to-player collisions and large model scales having other people get stuck in you. Anyone have any work arounds? I can't use matrix scaling because I want to keep the scaled hitbox sizes. Right now all I can think of is make it so my model has no hitboxes and just uses a fake hitbox entity. Then push out players near each other while disabling collisions between them.
[url]http://wiki.garrysmod.com/page/Player/SetHull[/url] [url]http://wiki.garrysmod.com/page/Player/SetHullDuck[/url] [url]http://wiki.garrysmod.com/page/Player/SetViewOffset[/url] [url]http://wiki.garrysmod.com/page/Player/SetViewOffsetDucked[/url] You'll have to multiply the default hull and view offset by your model scale and call these relevant functions.
I do that already. I'm saying the function is bugged and I need a work around. In case I wasn't clear: SetHull changes both your OBB and hull. SetModelScale multiplies your OBB. SetModelScale does not multiply your hull. Conclusion: there is no way to have your OBB and hull the same size that I can see.
[QUOTE=JetBoom;43021162]I do that already. I'm saying the function is bugged and I need a work around. In case I wasn't clear: SetHull changes both your OBB and hull. SetModelScale multiplies your OBB. SetModelScale does not multiply your hull. Conclusion: there is no way to have your OBB and hull the same size that I can see.[/QUOTE] I didn't realise the SetHull stuff was that messed up. I do know that this was fixed in the Source engine's game movement code a while ago so that the hulls would be scaled with the model scale ([url=https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/shared/gamemovement.cpp#L707]see here[/url], [url=https://github.com/ValveSoftware/source-sdk-2013/blob/a0c29e7dd67abb15c74c85f07741784877edfdcd/mp/src/game/shared/shareddefs.h#L92]this macro[/url] uses the model scale on top of the normal hull).
Well right now I have three options: 1) Wait for garry to fix it. teehee 2) Recompile the model after changing it's scale and hitboxes AND recompiling the gmod skeleton with a new scale. 3) Making the player non-solid to all other players, pushing them out of this player if nearby, and parenting a bunch of invisible square entities to act as hitboxes.
Sorry, you need to Log In to post a reply to this thread.