News › Forums › RAIN › Sample Projects, How To, and Code › Sample Project: RAIN Attack Harness
Tagged: Sample Project Attack Harness
This topic contains 16 replies, has 9 voices, and was last updated by Crimson_Flare 1 year, 3 months ago.
March 5, 2022 at 5:53 pm #9113
Here is a sample project we get a lot of requests for. “How do I make my AI NOT attack in a straight line?”. To achieve this we use an Attack Harness which limits the amount of AI that can attack you at one time. No two AI can be in the same position at the same time and the AI picks the closest available position to attack even if the player is moving.
Play around with the distances and the amount of AI positions. If you have any questions, let us know!
Share this thread for others to download!
EDIT: A new version of the Attack Harness has been uploaded. Click on the link above to download it.
March 6, 2022 at 2:05 am #9205
- This topic was modified 2 years, 9 months ago by Jester.
Thanks!!March 6, 2022 at 2:17 am #9207
Great work! Thanks Unfortunately I have a little issue. Enemies are trying move outside the NavMesh but they can’t… Example on screen: http://s22.postimg.org/41w9ewlvl/issue.jpg
Please help me.
PatrickMarch 6, 2022 at 2:20 am #9208
March 6, 2022 at 11:19 am #9242
Jester I hate to be a bother but I have been trying to convert the scripts in the sample to unityscript and wonder if me replacing “out int attackslot” in the method “OccupyClosestAttackSlot” in class “AttackHarness” with just “attackSlot: int” will break anything.March 6, 2022 at 3:58 pm #9258
@kodmistrz - we’ll be posting a new version later today with a small change that will correctly release attack slots when off the mesh.
@deleaiye - I’m not a unityscript expert. Maybe someone else here knows how to use out params in unity script?March 6, 2022 at 5:31 pm #9275
If you define your function in JS/US, it cannot utilize ByRef parameters. However, if your function is defined in C#, you can call it from JS/US with Out parameters that are ByRef.March 6, 2022 at 5:48 pm #9282
A new version has been posted, please click on the original link above to download version 2March 7, 2022 at 2:20 am #9332
Very cool! Nice work on this guys. Works awesome even as you drag pillar (enemy) around it all updates.March 7, 2022 at 5:14 pm #9378
Thanks CodersExpo! Let us know any feedback you have.
JesterMarch 7, 2022 at 6:52 pm #9393
I just realised that I can use both C# and unityscript scripts in the behaviour tree. Which means I don’t need to convert the scripts to unityscript.That’s awesome.March 7, 2022 at 8:29 pm #9397
Lucky. I can’t use Playmaker in the behaviour tree. I still have to do the C# scripting.March 12, 2022 at 1:34 am #9678
I have a little issue with this sample project. My AIs have problem with collision each other. Sometimes when they enter collision, they start flying in the air…
Example on the screen:
Please help me.March 13, 2022 at 2:12 pm #9783
Are you using a character controller? If so maybe the step offset is allowing them to walk over each other. Maybe add some colliders specific to AI to AI collisions to keep them from walking on each other. Try that and see if that helps!
JesterMarch 14, 2022 at 12:26 am #9808
I’m using capsule collider as in sample project. I have many issuses. I attached video: http://www.youtube.com/watch?v=YAuKrVXWVco You can see it. Thank you for your reply.
You must be logged in to reply to this topic.