Engine icon indicating copy to clipboard operation
Engine copied to clipboard

Feature: New keyvalue for "func_physbox" preferred carry angles to stay vertical

Open HugoBDesigner opened this issue 3 months ago • 0 comments

Which component should be improved?

Entity

Describe your feature suggestion in more detail

The func_physbox entity has a keyvalue called "Preferred Carry Angles". This angle is only applied if the flag "Use Preferred Carry Angles" (65536) is enabled. My proposal is for an additional keyvalue (or flag if needed) that allows for the provided preferred carry angle to always "stay vertical". What this would mean is that the player's pitch is not considered, and the object stays axis-aligned with the Z axis. Bonus points if this can be configured more freely, such that any axis (or general vector) can be fixed.

Right now, one possible "workaround" is to attach a script to the func_physbox which takes the player's eye angles and manually updates the preferred carry angles accordingly:

function Think() {
    local _angles = GetPlayer().EyeAngles();
    
    EntFireByHandle(self, "addoutput", "preferredcarryangles " + (-_angles.x) + " 0 0", 0.0, self, self);
    
    return 0;
}

Which results in the following behavior:

https://github.com/user-attachments/assets/8ce6072b-13f0-4f39-807f-aaccc8aa6721

HugoBDesigner avatar Sep 07 '25 14:09 HugoBDesigner