I’ve been programming in UC for a while and now when U4 came out we decided to move our game into U4 for various reasons, and i’m struggling a little. I could use some help if it’s not a big deal.
I’m trying to implement 2 functions into my game, crouching and sprinting which depletes over 10 seconds.
This is how they’re declared, you’re basically not overriding anything actually. I’ve never worked with UE3 before, so i have no experience at all, but are you sure you have to override these methods? Seems like everything is handled in ACharacter.
Took a look on GameFramework a bit. You should bind your Crouch button to ACharacter::Crouch, bIsCrouched is handled within UCharacterMovement component. To make a crouch animation you should edit corresponding AnimBlueprint the way you want, JumpEnd JumpStart states from third-person example would be a starting point here.
Jumping is also implemented in ACharacter and animation controlled via blueprint. To make a character sprint/walk i simply set CharacterMovement variable “MaxWalkSpeed” to various values. I’ve set walking speed to 100 and running sprint to 450, it fits my “ideas”. You might want to edit blendspace little bit to make a smoother look of animations.
smile do you have a skype account where we could talk a little ? I’m starting to loose hope here. and seriously thank you for all the help so far. or you add me on skype at ionut7122
Smile can you please add me on skype if you can. ionut7122 i’m seriously starting to loose all hope on this. and thank you soo mch for all the help so far .
This is a C++ issue. Because ACharacter defines OnStartCrouch as a virtual function in the base class but you have a non-virtual function of the same name in the subclass, you are inadvertently hiding the base class function.
The easy solution is just rename your OnStartCrouch/OnEndCrouch functions to something else.
EDIT: Added some extra links and clarifications, I must say I didn’t know about this particular behaviour, so I learned something new today while looking in to this
Not exactly, your suggestion won’t actually compile because the OnStartCrouch() without parameters doesn’t override anything as the base class has two float parameters. What Leeroy712 is trying to do is respond to an input event and thus it must have an empty parameter list. Because of the (kind of weird) C++ standard he will need to rename his functions so they don’t hide the base class.