Hiya,
This is a bit difficult to explain so im sorry if its a bit long.
Im making an RTS.
So, I have unit that moves with a character controller. I also got a tree in my scene (basically a cube scaled only on its y axis). when I select my unit and make it move anywhere, it works fine… Also when I click on the tree to make the unit move there it works fine. when the unit nears the tree the unit will do a “gather wood” animation wich works fine. Now I’ve placed a trigger collider (sphere collider set as trigger) on the tree to detect if there is anyone near it and does the gather wood animation, give wood every second or so.
however, when I click on the tree to make the unit move there instead of moving directly towards the tree, the unit moves between the tree and the inside edge of the sphere collider and spins uncontrollably. the unit always favors a certain spot when the collider is on. when I deactivate or remove the collider and let the unit move towards the tree again it works normally.
I tried different colliders and came to the conclusion that if I either remove or make the collider just to small for the unit to enter, its the same regardless of whether its a box collider, a capsule collider or whatever. if its too big, it will spin uncontrollably inside that collider on the exact same spot as last time which is somewhere between the positive z axis of the tree and the edge of the collider.
Is the collider messing with the character controller collider or something?
I know its not a script issue but if it can be fixed through scripting then I prefer c#.
Ohw and yes, the collider is set as trigger.
If you need more information, please feel free to ask.