Announcement

Collapse
No announcement yet.

CharacterMovement access in 4.7.5

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    CharacterMovement access in 4.7.5

    Hey. After updating to 4.7.5, I am looking to find a good work around for a change that is being made. The certain members of the UCharacterMovement class are being made private, and Visual Studio is now spitting out an error telling me any value changes i'm making to certain member variables, like CharacterMovement->MaxWalkSpeed = x;, is no longer valid, and that I need to use the GetCharacterMovement(); function.

    How would I go about changing certain values in code? Right now, I made a workaround in blueprints, but I am wondering how I could do this in code as well.

    #2
    I can't say for sure, but normaly you have Getter and Setter functions for private variables.

    So if you can't do

    Code:
    CharacterMovement->MaxWalkSpeed = x;
    Then you should be able to do something like this:

    Code:
    GetCharacterMovement()->SetMaxWalkSpeed(x);
    But i can't guarantee that the Setter function is called like that. Just look what VS gives you when searching
    for MaxWalkSpeed or other private variables. Same goes for the CharacterMovement itself.

    You can also check the Source Code (or better the API itself) to see what variables are private and what functions are available.
    Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

    My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
    (Including 100+ Pages Multiplayer Network Compendium to get you started.)

    Comment


      #3
      It is not the members of the component that have been made private, but the component pointer itself. You simply need to do:
      Code:
      GetCharacterMovement()->MaxWalkSpeed = x;

      Comment


        #4
        Originally posted by kamrann View Post
        It is not the members of the component that have been made private, but the component pointer itself. You simply need to do:
        Code:
        GetCharacterMovement()->MaxWalkSpeed = x;
        Thank you so much. This helped out a ton.

        Comment

        Working...
        X