Ok I have made a Working Unit for a Multiplayer RTS, which will engage the unit on the other player’s team. But, The Unit on the other team dose not attack the attacking unit. I have tried for the last week to get it going. I am not using Blackboard for the AI, I am only using Blueprint. So Far I have Added Pawn Sensing in hope of getting the AI to recognize the Attacker. To be Clear I am doing all this in the Base Unit File which is the main file holding the important info for Units to do the functions needed for the game, and will make all Units child files of it. So I am trying to find out how figure out how to add references that can work to help make this problem work. If anyone can give me some points please let me know and thank you.
Hey there @Lonestanding27! So first thing I’d ask is have you checked to see if the pawnsensing has seen the pawn or not by printing what it sees? This would be a good first step. Then we can verify if those BPI’s are the things failing, and lastly check on the attack side.
Okay, Tried it and it is seeing the Units, then I updated the code, but instead of the unit under attack moving to a seen unit, the attacking unit just attacks them LOL. So then I tried to putting a new command through the BPI to get the unit to defend itself, but still get the same result, I am lost.
Bump
So it’s able to see the units, but the blueprint interface isn’t defending? For your defending distance branch at the beginning make sure you pop a print there for every time it fails. Follow the chain down and verify the BPI actually runs. Your BP doesn’t seem to be the problem if the BPI’s were to go through. If they are going through and nothing is happening we might need to see if the RPCs are functioning. All of your procedure calls are server side right?
Looked into it today, it seems it is not even register anything, I looked at the AI and found out there was no Sight or Damage Sense, so I added them. Will be seeing if I can use Damage to a Unit as a prompt to Attack the Attacker, or see if I can set it up to if the Attacking unit enters a radius that the Defender can Attack. I will keep updating this thread, if anyone knows how to set this up please let me know. The pic is the part that was not added on the AI:
Bump
So you can take the damage causing actor from the damage event and use that as a reference to the attacker. Then you would need to call your custom logic for the enemy to stop what it’s doing and move to then attack the target. I’ve got a tutorial for setting up the AI sensing for multiplayer below as well.
Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.