Download

How to detect from what angle you are damaged.

Hi All

Asked this before when I was new and did not work it out.

Example, you shoot a bot in the side, he will turn to the direction of damage.

Tried this, but nothing.

c1b397d8dffdaed46a068cbb84f6e6f731a8e4bc.jpeg

Narg

Hm, first of all, this is inside your bot BP? Would the “Find Look at Rotation” be other way round? The Target should be the DamageCauser and not the bot.

Could you tell me what you are experiencing when you use your setup (with the Find Look at Rotation fixed)?

I can’t track down the problem without knowing what is happening right now.

If i see this correctly, as soon as the Bot is hit, you check if the bot can already see the Player and if not, he will turn to him.

That should work this way. Can you also make sure that the nodes are called correctly by debugging it?

Ok, it shutters now after being hit,

So I need to go through the rest of my scripting and BOOL up.

Cheers, Could not see the trees for the forest.

Narg

Works. Just now got to fix an error I had for ages.

LOL

Error Accessed None ‘K2Node_Event_DamageCauser’ from node Set Rot Not Equal to Last Scan in blueprint Turret_Pawn_BP

I do not expect anyone to know that answer.

LOL

here is a solution

Turret BP:
026b77b0563ae21f49f14be9e1dd82a32b9744cb.png
99ae75bed3ecdb1517ea26f54016d5b7f20d1f59.png
60419b62661d4a03706b7ebc775e65633e6d98c5.png]

https://youtube.com/watch?v=VS3rwOkABow

Nice (: so you passed no DamageCause and it was ‘null’. Always make sure to check your pointers. There is a node called “Is Valid”. Or better, there are two, but i mean the one that is NOT returning a bool.
The other one has 2 exec outputs with “Is Valid” and “Is Not Valid” or something like that. The input takes an actor pointer (like the damage causer) and it will only exec “Is Valid” if the pointer is not null.

Make sure to use these. In C++ you ALWAYS check pointers with an if(DamageCauser). In Blueprint you should do this too!

Thanks guys,

Some things are easier later in life.

Works;

[video]https://youtu.be/jcjlq1VRX40[/video]

But I have realised error in the return volume.

MORE BOOLS.

Narg :slight_smile: