How can I use a variable from another BP?
Great question! The process is actually pretty simple...
1. The first thing you will need to do is set the variables to public so that they can be accessed by other blueprints. You can do this by clicking the "eye" at the right end of a variable.
2. Next, you will need to create a reference to your character inside of the Event Graph (Get Player Character -> Cast to "your character here" -> promote to variable -> "Player".
3. You now have access to all of the player's public variables via the "Player" variable.
Let me know if anything still needs clarifying and I'll be happy to help.
Just make sure to make them public before you could use them in over blueprints. Also make sure that you have the correct instance of the blueprint for you to get references or attributes from that blueprint.
answered Nov 03 '16 at 07:32 AM
The way to go about this is to just use a single cast to your CharacterBP in your animationBP.
Here I just wanted to show all the variables I have in my FirstPersonCharacterBP that I can call later in the animationBP.
Use a simple cast to access all of the variables you created, in your case either a float or int variable to check when it is equal to 1. The object of this cast here is 'TrytogetpawnOwner' which is usually your playercharacter.
I don't know if you are familiar with state machines but you can set the whatever condition you want in order for you character to transition into the animation you want. In my case here my when I hold down a button, it sets the 'Firing?' boolean variable to true which allow my character to enter the shooting animation.
Hope I answered what you are looking for. Hope this helps.
answered Nov 03 '16 at 07:20 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here