Have you defined “Crouch” in the input settings? Have you checked to see if the events are firing by placing log messages in your StartCrouch and StopCrouch Methods?
Interesting. I see you have set NavAgentProps.bCanCrouch;.
Is the RootComponent Simulating Physics flag set to true? The only other thing I can think off is the “Crouched Half Height” ins’t set correctly. If you want to can you share your project so I can take a look?
Are you able to zip up the project and share it from google drive. Or can you share it via GitHub or Bitbucket (Bit bucket if you want to code to remain private).
CanEverCrouch checks the NavAgentProps.bCanCrouch is set to true, which you are setting. Are you able to check if IsSimulatingPhysics() is returning true? This should be true, but worth the check, you never know!
hi i forgot about google drive haha, but here it is, i uploaded it in mediafire, if its lacking files i can upload more, thanks to you too! i have been stuck with this problem for atleast 2-3 days ;(
I got the Camera to react to the crouch with your code (Copy and pasted it into third person template project). One thing I noticed is that UE4 tends to not take the constructor changes into account for the blueprint if the blueprint is already created. The only work around I know of is to either recreated the blueprint that inherits your code.
One way to check to see if your constructor is working correctly is to check the CanCrouch under the “CharacterMovement” component in the blueprint. When we set GetCharacterMovement()->NavAgentProps.bCanCrouch = true; this will make the checkbox to be checked.
If all is well you will see the camera and the movement speed react to the crouch click. From there you will need to set up the mannequin’s crouch animation. Not sure why it doesn’t come default. Here is a link to a tutorial you might find useful [link text][1]
If you still cannot get it working send me your full project and I can make the change and send it back.
sorry for the code comments and some swearing on my code hahahaha
hey i tested it out to see if it works on my projects side,i changed the crouched speed to 100 to see the difference, but it seems that when i press C, i wasnt slowing down ? hmm sorry
i was making sure before learning adding the animation thing.
You will see the camera drop down if the crouch worked. I noticed a slight walk speed change as well, but the camera was a big indicator. Also, ensure that the “Can Crouch” box is ticked in your blueprint instance of the character as seen in the image above to ensure your constructor changes took affect!