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"

Set MoveSpeed for AI Character in a BT_Task? running/walking speed change

With a Task, you can get an AI Controller that is assigned to an AI Pawn or Character and using get controlled Pawn. However, as a Character is a class that inherits from Pawn, Pawn itself doesn't have a CharacterMovementComponent that a Character does have. How then, would one obtain an AI driven Pawn's maxWalkSpeed from the MovementComponent, which determines how fast they are walking. This is for changing the speed into a run like pattern(which we'll change using a running animation in the character blueprint too) and vice versa.

For the record, this is for a project where the AI pawn will "run" to a random target point away from the player should they get close, and after they are far away enough and reached the point, they return to walking speed.

Product Version: Not Selected
Tags:
more ▼

asked Feb 24 '15 at 04:07 AM in Blueprint Scripting

avatar image

MajinKen
58 17 24 33

avatar image Gigantoad Apr 13 '15 at 06:26 PM

Trying to do the same thing. How difficult can it be? Have you found a solution?

avatar image MajinKen Apr 13 '15 at 06:28 PM

Surprisingly very simple. Just get the controlled Pawn of the AIController and get its Movement Component, cast it into a Character Movement Component before you can change its Max Walk Speed.

avatar image Gigantoad Apr 14 '15 at 11:06 AM

Ah yes, that last cast got me. Thanks a lot!

avatar image btms09 Sep 19 '16 at 11:14 AM

can you place a pic up of this please

avatar image hxg946470289 May 02 '16 at 01:58 AM

I took a long time to solve this problem, for several hours, I was inexperienced, thank you very much

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
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