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"

How can I take a Float Variable from a PlayerCharacter Blueprint and call it in an Animation Blueprint?

I have a player chracter blueprint that has all the settings for the player. It has changeable stat bonuses that i want to use to change animations. In this case running to sprinting. So i have the standard blendspace for idle-->run. Then in the player blueprint I have, At button press, increase max speed. The amount that the button press changes the MaxSpeedSprint (floatvariable) is dependent on an AgilityBonus variable. Theres also a MaxWalkSpeed float variable.

What I want is for my animation blueprint to compare the characters current speed (easy and done), to the MaxWalkSpeed float variable. Using something like Speed>MaxWalkSpeed=true in order to enter the next transition.

Basically the MaxWalkSpeed and MaxSprintSpeed will change throughout the game and the animation transition should follow suit. I assume it has something to do with casting but i cant seem to get it to work.

Product Version: UE 4.8
Tags:
more ▼

asked Dec 28 '15 at 01:24 AM in Blueprint Scripting

avatar image

asydney25
1

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

2 answers: sort voted first

Hi man , You have to get the reference to your characterPlayer. and from that get his variable. You can set a variable "actor tipe" to store manually in the editor (from a scroll down) the instance of you char. Otherwise you can use the node "get all actor of class" to search in Runtime, for all the Char-instance. Then pin out the "Get 0" , from the array. and now you can set and get all his variable.alt text

more ▼

answered Dec 28 '15 at 12:32 PM

avatar image

Est_engine
1.2k 58 12 62

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

Thank you! That sounds about right. Got work today. Will have to try later on tonight. Thanks again.

more ▼

answered Dec 28 '15 at 02:47 PM

avatar image

asydney25
1

(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