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:
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)
Go to orginal destination.