x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[C++]How to get my CharacterMovement?

Hello I have MyProjectCharacter. How can I get CharacterMovement? i use this command and I don't know, that's next? AMyProjectCharacter::GetCharacterMovement;

I want to set new max speed from code.

Product Version: UE 4.12
Tags:
more ▼

asked Jun 26 '16 at 05:09 PM in C++ Programming

avatar image

Voodoo_Magick
21 2 3 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

I did it. I should just:

  GetCharacterMovement()->/*Do what you want*/

Thanks for help!

more ▼

answered Jun 27 '16 at 07:02 AM

avatar image

Voodoo_Magick
21 2 3 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hey Vodoo_Magick,

GetCharacterMovement return the UCharacterMovementComponent which is applied to your character. From there you can access and set specific variables which help you configure your movement.

Maybe the API helps you

Unreal UCharacterMovementComponent API

Greetings Cloudy

more ▼

answered Jun 26 '16 at 06:20 PM

avatar image

Cloudy McStrife
465 13 16 38

avatar image Voodoo_Magick Jun 27 '16 at 06:37 AM

I know it. But I don`t know the name of CharacterMovement component. How can I access it? I wanna get something like this: AMyProjectCharacter::GetCharacterMovement; CharacterMovement->MaxWalkSpeed = 600;

avatar image Cloudy McStrife Jun 27 '16 at 10:05 AM

You could store that in a variable. GetCharacterMovemtn just returns a Pointer to the CharacterMovement but the expression itself doesn't do anything if you don't store that pointer somewhere.

auto CharacterMovement = GetCharacterMovement(); will do the trick.

Or just GetCharacterMovement()->....;

Greetings Cloudy

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question