How to set an instance for a blueprint-reference

Hi,

I’m quite new to the Unreal Engine and am messing a bit with characters and animations.
Here I have the following problem:
I want to acess the instance of a blueprint from another blueprint. From what I found out here: Direct Actor Communication Quick Start Guide | Unreal Engine Documentation
I have to create a new variable, set it to the type or parent type of blueprint i want to adress, make it public and then select the reference from the Detail panel.
The problem is: I can’t. The instance i want to select shows up in the drop-down menu, but if i select it, nothing happens. Same for the pipette. And if i drag my character from the scene onto the drop-down menu, it gets a green border, but again, nothing happens…

I tried this with several obejt types in diefferent blueprints, but could’t get it to work a single time. Can anyone tell me, what I’m doing wrong?

Thanks, Asgatoril

19803-unreal2.png

19804-unreal1.png

You should communicate with Anim Blueprint using “Get Anim Instance” from blueprint class in which Anim Blueprint is used

Hi,
I don’t really want to pull my information from my animblueprint into a normal blueprint, but to change a c++ variable, which is exposed to the referencing blueprint, from the animblueprint, when an animnotify is fired.
This works fine for the players animblueprint:

But not so well for other characters, where i can’t get the reference to the character i want:

Where that varable is? and where you want to change it?

Its the variable “FireReady”, which you can see on the right side of both Screenshots. Its declared in MyCharacter and in MyEnemy in the same way.
I want to set this variable as soon as the AnimNotify “SetFireReady” is triggered, so this scraps are both from their respective AnimBlueprint, which i use for the animations for MyCharacter and MyEnemy.
The Background is, that I want to fire a projectile at a specific point in an animation sequence. So I set this variable and check in my c++ code if its true. If yes, I fire the projectile and set the variable back to false.
This works perfectly in the first case (MyCharacter, first Screenshot), but wont work for MyEnemy, since i can’t get the reference to the instance i want to access.

Hmmm why don’t you make other way around, do variable in C++ for animation blueprint (it’s also a class as any other blueprint called UAnimInstance UAnimInstance | Unreal Engine Documentation and you can use it by changing base class of animation Blueprint), and then check state of that varable from GetAnimInstance (USkeletalMeshComponent::GetAnimInstance | Unreal Engine Documentation)

I will allow you to avoid all od this variable setting in details, character and enemy code will simply use variable if it’s used (you check if anim instance is based on you C++ class)

Thanks, that works :slight_smile:

Still, do you know, why i can’t create a reference to a blueprint, even though the editor shows me, that the value I want ot enter is valid?