- Home /
Question by
unity_D4E07EABFD3D22AF0DF9 · Nov 09, 2021 at 08:32 PM ·
2d2d gamewanderdetecting
Unity2D UI detecting spawned object
Hey, Im working on a game in 2D world top down view. I have AI wandering kinda randomly in a set square box. I also made OnClick method to spawn an object wherever i click. It also has coroutine to despawn after 3 seconds if not collided or despawn on collision. I am trying to figure out how to make wandering AI detecting spawned object and run towards it. My wandering code is also kinda not optimized but its my first time and i couldnt figure it out other way. I ask kindly, how i can implement ''stopping'' that wandering code, move towards spawned object, and grab it(just collide for now) or come back to wandering if it despawns.
Comment