Allowing player to stay crouched while interacting

CraigHubbard

New member
The interact script seems to be forcing players to stand when crouched. I haven't found any way to disable this behavior through the inspector, but I can fix it by commenting out these lines:

public override bool ShouldStopActiveAbility(Ability activeAbility)
{
return activeAbility is HeightChange || activeAbility is StoredInputAbilityBase;
}


I'd rather not mess with scripts if I don't have to, though, so I'm wondering if there's a better solution.

Thanks!
 
I think sometimes you just have to modify scripts, likely you only want to comment out the first part of the return line? not sure what the second part is?
Save your new script with a new name outside of the UCC folder and select it as your ability. This way when you update UCC you will keep your script when the old one is overwritten.
Depending on the interact ability, you may want a crouched interact ability animation which can be blended with the demo Animator's height parameter.
 
Thanks, DankP3. I went ahead and did that for the time being. I'm always reluctant to mess with scripts because I lack the coding fluency to anticipate the kinds of problems I might be causing when I do. But so far it seems fine.

Either way, I do think there should be a simple override for the "automatically stand up from crouch" thing, as it doesn't seem likely most developers are going to want that as a default. I actually only noticed it because I'd set up a scenario where you need to slide a panel out of the way to exit a crawl space and found myself clipping through the ceiling.
 
Top