Link Pawn to Sprite

Hey,

Anyone know if there is a way to link a Pawn to a Sprite?

I want to add A.I to my game, to my knowledge the only way to do this is through an A.I Controller and the controller needs to be attached to a Pawn. Which is fine if your game is 3D. However I am trying to make a 2D game where my sprites have A.I to drive their actions. However there is a disconnect between the sprite and the Pawn that I am having difficulty with.

So if I have say 4 sprites on screen I have 4 Pawns. Now when the sprite is hit, it takes damage, but the pawn is totally unaware…so the A.I that says “heal damage” will never trigger. I have 4 pawns so getting all the actors of a class is not going to work either because I don’t want them all to heal or all to be damaged.

So am I missing something really dumb? Is there a way for the Pawn to handle all the functionality of the character, health, A.I and so on but have that linked to a sprite in UMG? Or is there a way for a widget to be driven by an A.I controller and have A.I?

Thanks

Hi there! Just check out UWidgetComponent, UBillboardComponent or UPaperSpriteComponent. Add one of them to Blueprint around some base class like ACharacter or APawn and that’s it…

Thanks for the reply.

In order to use those I assume you would need to be using a C++ project?

No. You can add them in BP Editor also…

Thanks!

I looked in to them, I haven’t worked out how to solve my issue with them, but they certainly are very interesting and could very well be the answer if I can work them out enough.

If Anyone wants any more information on Sprite and components this is a good starting video: