In my character’s code, I want to be able to change GetCharacterMovement()->MaxWalkSpeed, so that when I’m sprinting, for instance, I can move faster than normal. However, I would not like to have to write that all the time, so I made a variable,
float & DefaultSpeed = GetCharacterMovement()->MaxWalkSpeed;
However, I cannot make it a UPROPERTY, or UE4 will crash. How can I create a reference variable in C++ that can be seen and changed in blueprints?