Our default capsule half height is 88, so crouching will set this to 40 (or whatever value we set here), while un crouching will set this back to 88. Here’s where the default is set (with Character Movement selected in the viewport): In other words, when we crouch, the collision capsule around our character will become smaller. The crouch/uncrouch function will set our character’s capsule component’s crouched half height (yes… quite a mouthful). Let’s wire them up via a Branch Node, checking the incoming Is Crouched boolean (we’ll set this in the next step). It has two functions we can call: Crouch and Un Crouch. The crouch-ability is part of the Character Movement component, which in turn is part of the Character object. Let’s add the interface we’re using to our Player Character. We need a boolean input called isCrouched as well to communicate an already crouched state. Our interface only needs a single function.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |