Closed seanxpw closed 3 months ago
btw to test this make sure to switch the map to Content/Maps/AttackTestMap.umap
@NateBeatty in BP_DummyEnemy, I created a custom event to receive damage.
So if u wish to deal damage to my dummy enemy, feel free use apply damage
, below is how i deal damage to enemy by missile in BP_missile.
Additionally, If you want to cause damage to the same enemy as my laser's target enemy. you'll need to use this variable in Content/BluePrints/Planet_ParentBP.uasset
This variable keeps the nearest enemy to gate within attack range.
But You CANNOT expect this vatiable to always be valid, so make sure do validation check before applying damage.
Function Set Target to Nearest Enemy To Gate WIthin Range
updates this variable every 0.4 seconds.
btw this is the logic in BP_Laser to chase an given enemy every tick. you could try use the same logic to apply damage.
If you want to cause damage to another enemy instead of the nearest enemy calculated as above, you might want to change my laser beam end. This event in BP_Laser is unused for now.
big update in BP_planet see dc for details lol
Please review it along with PR #23.
Content/BluePrints/LaserBeam/BP_Laser.uasset
Content/BluePrints/Planet_ParentBP.uasset
and blueprints to assign an enemy for the laser to chase for.Content/BluePrints/Utilities/BP_UtilityLibrary.uasset
This function returns a sorted array of enemies based on the distance to gate note that the sort function is implement in c++ for convience and performance.Content/TA2Project/Non-PlayerEntities/TA2_Gate_Prototype.uasset
to keep sorting the enemy array.Note that the laser beam won't cause damage to the enemy. It's only a visual effect. It's possible to break the assigning enemy logic if the game has more than ONE gate