Can someone explain to me how to use object reference correctly?
Lets say i have an Enemy BP and a fireball BP, both are from different classes
I want to be able to have a reference to Enemy BP that i can access from fireball BP
I need the reference so that i can use it to tell Unreal that i want to do things like get enemy location, get enemy rotation, get its velocity, get what its eating, get who the enemy is sleeping with behind fireball’s back, etc. You know… the usual stuff.
The way i thought i could do this is by making a variable EnemyRef in Enemy BP and making it public.
Then using Get EnemyRef in fireball BP and use its pins to do amazing things. But in reality this is what happens:
But i dont know what connection to make to Target so here i am wasting your time asking… HELP ME BROTHER.
You need some way of telling which enemy you’re talking about. Do they have an ID like an integer of something?
PS: You’re going the wrong way with the target node there, it usually appears automatically when you drag a pin from a reference. I don’t think you can reverse engineer it…
EDIT: If there’s only 1 enemy, then you can just say:
Thanks for the reply. You are great as you may know.
Yes i only have one actor and destroying actor is not the problem. I just wanted to see how to use object references in other blueprint properly.
But i realise you cannot use it like that and using object reference variable made in one blueprint but used in another is not the right way of doing things. A better method would be appreciated.