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 to get Player Character from animation blueprint

Hey,

I have a variable in my character blueprint that I want to access from my animation blueprint. I've tried 'get character' and cast it to my character class, but it fails.

Any ideas?

Product Version: Not Selected
Tags:
more ▼

asked Mar 13 '15 at 03:55 PM in Blueprint Scripting

avatar image

Ixaeon
50 16 14 18

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

2 answers: sort voted first

First, you need to make your variable editable in your character blueprint by clicking the eye icon on the right side of the variable.

alt text

Second, get or set the variable by casting your character blueprint inside your animation blueprint just like the second image.

alt text

I hope that helps.

1.png (749.7 kB)
2.png (2.5 MB)
more ▼

answered Mar 13 '15 at 04:13 PM

avatar image

Syne
6 2

avatar image Ixaeon Mar 16 '15 at 07:35 AM

Hi thanks for the info. Unfortunately, it's not working. I've set it up like you did, but when I try to cast to my characterclass, it fails.

edit: Ok if I try to print the display name of the pawn owner, it just gives an empty string. This means there is no pawn owner?

avatar image SolarVelocity Jul 07 '15 at 12:33 PM

Try putting an "Is Valid" execution node between your event and cast nodes and use your get pawn owner as input to it.

Then the event will only fire if the pawn owner is a valid pawn object.

It may be your event is firing when there is not yet a fully constructed pawn object to work with

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

Managed to solve this. Instead of getting my character class in the animation blueprint, I got the animation instance in my character blueprint and set my variable that way.

alt text

solved.jpg (25.9 kB)
more ▼

answered Mar 16 '15 at 08:39 AM

avatar image

Ixaeon
50 16 14 18

(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