Hello Everyone…
I am making 2D space shooter kind of game and in that i have scene with x-y plane.
Here i am translating my enemy object in y direction from top to bottom… But i want my object to change direction after crossing some random distance means i want my object to move left or right diagonally after some random distance…
But i am not getting the way to perform this behavior as i know how to translate object diagonally…
Code which i used is here :
whatWayToGoInLife = Vector3.left * amttomove;
whatWayToGoInLife = whatWayToGoInLife + Vector3.down * amttomove;
transform.Translate(whatWayToGoInLife , Space.World);
But main problem is after crossing some distance on y axis i want my object to move in random direction…
Pleaze someone give me idea…
Thanks in advance for your support and help…