Change Player Collision box height ingame ?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
LOZ_98
Posts: 67
Joined: Thu Mar 22, 2018 7:46 pm
Graphics Processor: nVidia (Modern GZDoom)

Change Player Collision box height ingame ?

Post by LOZ_98 »

Is it possible? I'd like to be able to change between 2 heights ingame, I already tried Morphing the actor but it seems this isn't seamless and breaks whatever the player is currently doing, crouching is too limited, height can't be changed, and as far as I know there's no way to tell the game to stop changing the player speed or view height when crouched.

Any workarounds? Thanks.
User avatar
Caligari87
Admin
Posts: 6242
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: Change Player Collision box height ingame ?

Post by Caligari87 »

[wiki]A_SetSize[/wiki] will let you change the actor's height/radius on the fly. If you want to change the crouching/movement behavior you'll need to use ZScript and override some of the built-in player code (such as MovePlayer, CrouchMove, CheckCrouch, etc).

8-)
User avatar
LOZ_98
Posts: 67
Joined: Thu Mar 22, 2018 7:46 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Change Player Collision box height ingame ?

Post by LOZ_98 »

Cool, exactly what I needed, been searching for ages I must have missed it, thanks so much :)

Return to “Scripting”