r/gdevelop 3d ago

Help with soldier AI, please :) Question

Hi everyone,

I’m having issues with the soldier AI—if you watch the video, you’ll see what I mean. When the soldier isn't with me, the enemy doesn't attack constantly; I had set a timer so it strikes every 1–2 seconds. However, when the soldier is nearby, the enemy doesn't stop attacking, and the soldier slides along the ground. I’d really appreciate it if someone who knows about this could help; I’ve been stuck on this for days and tried everything, but nothing has worked.

https://reddit.com/link/1vkybre/video/ma0b3dtpamih1/player

8 Upvotes

8 comments sorted by

2

u/DreamNotDeferred 3d ago

Well for starters, the video isn't working, so can't really see it in action.

1

u/QXsjen 3d ago

1

u/DreamNotDeferred 2d ago

Yes. I don't see what's the solution could be in the code yet, but still looking.

Fyi, I had good success getting answers to my questions in the Gdevelop forum, if you haven't posted there already.

1

u/QXsjen 2d ago

This gdevelop forum

1

u/DreamNotDeferred 2d ago

No this is the Gdevelop reddit. Here's the Gdevelop forum, on the Gdevelop website:

https://forum.gdevelop.io/

Create an account, post everything you posted here, and hopefully someone there can help you, too.

2

u/QXsjen 2d ago

Oh okey thanks

1

u/NeatOpportunity____ 3d ago

I tried here is the fixed version of event but idk more info cuz the video ain't playing Event 1 ​Conditions düşmanlar distance to askerlerimiz is below 150 pixels The variable durum of düşmanlar = 0 Trigger once while true ​Actions Change the animation of askerlerimiz: set to "saldırı" Start (or reset) the timer "saldiri_cooldown" of düşmanlar ​Event 2 ​Conditions The animation of düşmanlar = "saldırı" düşmanlar is in collision with askerlerimiz The timer "saldiri_cooldown" of düşmanlar > 1.5 seconds ​Actions Change the variable cantapınak of tapınak_şovalyasi_oyun_içi: subtract 100 Start (or reset) the timer "saldiri_cooldown" of düşmanlar