If tried everything I know off and it still wont work.
I’m trying to create a simple Logic movement for the npc’s in my game.
I used the debugger to check the Boolean variables and they revert back to true after the reach their Movement Marker but I think it has something to do with the timer.
Here’s my code:
When I change the Minions Boolean variable (Idle) to false, then they move to their location fine the first time and sometimes the second time after that. But most of the time they just stop after the first movement is complete.
If I set the Minions Boolean Variable to true, they do nothing.
I haven’t used Gdevelop for almost a year now and I dont know if any major things were changed and if thats whats causing the issue.
any help pls.
I can’t give you a specific answer that will solve everything, but a few things I noticed:
- You cannot set a timer that way. Putting random() in the timer second means the timer condition changes every frame. You will need to set a variable to the random value and use that for the timer, then rerandomize that value whenever you reset the timer.
- pathfinding moves need to happen once, otherwise the path is constantly updating and you could eventually bog down the pc running the game. I don’t have a good suggestion on how to fix this with your current events since trigger once doesn’t work in for each events.
Ty, will try the suggestions and get back to you.
Would you happen to have an example of topdown npc movement logic?
Since mine is somehow seriously flawed
Everything seems to work fine when there’s only one Instance of that specific sprite on the screen, however, as soon as I add more than one, the only move once and then stay still
I still don’t have a solution to the this problem. Can someone please help. Since I dont know how to make an AI for the all the NPCs and assign it individually
I don’t have a great answer for you, but if you’ve updated your events you’ll want to post your updated events before anyone else can assist.
I’ll get back to that project. As of now, I’m busy with something else. Ty for your help. Much appreciated