Level BP to CharacterMovement (Inherited)

Hi People,
I have a Trigger Volume that when the player overlaps it, the Crawl variable is made True. When the player leaves the volume, Crawl is made false… and the player stands up again. This currently works fine. However, I also need to change the Max Speed of the Walk from 1000 to 200 and back again. I’ve tried casting to the CharacterMovementComponent, but I’m getting a compile error and I don’t know how to change it. Any help would be great, please?

Thanks.

You’re trying to cast a Character (an actor) to a CharacterMovementComponent (a component), so that will never work. All you need to do is drag off Get Player Character and then select Get CharacterMovement. You can then set the max walk speed from the CharacterMovement.

Hi cganim8r
You must do that

Thank you. :slight_smile: I thought I needed to get the player character and then find it component (which is what you have shown me).

I’m definitely struggling with what can cast to what and where? Is there an easy way to understand this? Can an actor only cast to another actor and can a component only cast to another component and, if this is the case, is it an easy thing to spot or does it just come with practice? I know certain things are colour-coded. So, I thought this might help, but not much. I have in my head that a Cast sends info to another area, but a Cast can also retrieve info, too. I think it’s going to take me a while to understand this fully… but, I’m enjoying the challenge! :slight_smile:

Thanks again. Most appreciated.

I believe this tutorial goes in depth on references, casting, etc within blueprints. Blueprint Communications | Live Training | Unreal Engine - YouTube
If not, just search for tutorials that involve blueprint communication, referencing, and casting. Understanding how referencing works in programming is a huge step in becoming a proficient coder.

I started tinkering with Arduinos and ‘C/C++’, last year. Haven’t looked at pointers, yet, but I’m alright with the simpler logic stuff and functions. Thanks again.

Thanks DemOnShadow. You’ve shown it slightly different than what I’ve done, but yours shows the logic I was probably trying to do… just yours works and mine didn’t. :slight_smile: