Hey There, at first i wanna say thank you for your very usefull tool.
Sadly i couldnt figure out how to use it properly yet.
I am working on a 2D Project in Unity.
and i run into some problems while i was working with gameobject pooling.
Sometimes they did clip through gridgraph sometimes they just stoped walking at some random point.
After i disable them i also tried to set their target null which diddnt change their random behaviour.
Now i did read in a previous post that if we are use pooling and de and activate game objects you said this here:
where do i have to call the onDisable function in order to solve this issues? yet my unitScript has a kill method
which checks its healthpoint if its equal or under 0 it will deactivate the gameobject, but i did not understand where to use the OnDisable method. Can You explain a little bit further please?
The OnDisable method is called by Unity, your scripts should not have to do anything.
I’m not sure why that would be happening. Do you see a green path in the scene view? If so, does it go to the correct destination? Do you have a video of the issue happening?
I uploaded 2 samples in one video on youtube the Link is here:
0:00 - 0:16 shows that they just stops
0:16 shows they clip and stoping randomly.
I only see one green path most of the time.
I noticed that the first wave where the GO get activated the first time they never have issues.
But after the first one they start to appear in some random way and not on every GO that has been activated before.
If i do instaniate and kill them all the time, there is no problem at all, this only happens if i use pooling.
Ok that helped a lot i guess. they wont clip anymore, and they seem to have a way more solid waypoint.
But now still there are a couple of GameObjects that dont start walking when they get actiated, and just stays at the startpoint doing nothing even they have a target active
I’m not sure why that is happening. I thought I tested disabling/enabling components with the previous version.
In any case. I have added a unit test for pooling to my current version. So if it is ok to disable object pooling for now I will make sure it works for you when the next version is released.