I was able to find is how to make it work. And it works…but what i can’t figure out how to make it work with game objects that have collsions2d and able to find it on path and hit it.
Destroy it and then continue to its path to destination.
What it currently does it just colides and tries to go thru object.
My problem is how to detect if its destroyable? How to move to it and attack it.
I can’t find anything about it…
like if path is blocked? Does it contain collision? Dose it contain IDamagable (interface)?
How to find on currentWaypoint on that specific tile while unit is blocked to find any tile that is can be damaged?
Here is example:
Spawn
Look for path.
Path is blocked
Check if there Damagable is on current path
Go to damagable
attack then check for path (in case we destryed)
Path found.
Go to orginal destination.
Sorry for the late reply.
The most common way to do this is to make all destroyable objects tag the nodes below them with a specific tag (say a tag named “Destructible”). Then on the Seeker component, you give that tag a very high penalty so that the agent will not move over it unless absolutely necessary. Then when you move your agent, you can use a raycast to see if it is about to walk into a destructible object. If so, you know that there was no better path and you can let the agent start to attack that object.
@aron_granberg you always mention this as a solution for destructible enviroments and it is great start. However, when I implement this solution there are many problems when destroyable buildings are not marked as grid obstacles. The RVO Controller pushes them into the building because it is only a penalty but still walkable and for example desired wall distance is not supported with penalties. Generally it would be awesome if you would know a way to implement pathfinding with penalties but the object still being an non walkable object as long as it is not destroyed.
My current solution would be having a seperate grid for calculating the path with penalties and another grid for actually walking that path with “real” obstacles. Or do you know a better solution?
I am currently using version 5.2 with the entity movement script with a hybrid ecs approach and any help would be awesome. Thanks!
Hi @Kaynoux, I think your best bet is to create a new thread for your issue, as this is a 2 year old thread. By all means, feel free to link and reference aron’s post in that thread, and we’ll be glad to help- I’m apprehensive about trying to help fix the issue in this thread, as it’s been long finished and I wouldn’t want the OP getting emails on this