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.

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 for the forest.

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

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.

here is a solution

Turret BP:



]

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;

But I have realised error in the return volume.

MORE BOOLS.

:slight_smile: