Is there any method or alternative to prevent Turret to targeting itself ?
I want to make online multiplayer top down shooter similar to io games, so, there will be a dozens player on a room. And if there is not enough player, system will create bot player.
Bot player and real player is a same object / sprite, and there is a separate sprite with pathfinding and turret behavior, Bot player will be pinned with this sprite and a variable for bot identification.
Bot movement > use pathfinding to patrol/moving, and if turret are detecting target, bot will star shooting.
Target for turret are grouped using families (pick nearest target)
Is there any solution for this?
Develop games in your browser. Powerful, performant & highly capable.
I would first select all the turret family except the one doing the targeting, they you can pick nearest...
Thanks for your reply
But, i don't think it's working with real Turret behavior (exclude specific uid), i already tries this and not working.
If i use pick nearest every tick, it's may slow down the game performance especially on mobile device and there are many object that are checking every tick (for each).
I don't believe the turret behavior has a way to exclude specific instances of objects.
You should probably work at recreating a similar result with events, which you will have much more control over.
Yeah, i better to forget this things until i find a solution in the future, just separate bot object and set target to real player, so, player will know if an object is a bot.