I am making a game with ghost enemy that follow the player ,but all of them would go collapsing for the player, I have read an article that i create a random position close to the player for the enemy to go to and when he reaches there he goes to the player directly,and the ai behavior I am using takes a transform component not position so I would like to create the random transform for that
You can’t create a Transform component all by itself. Similarly, you can’t create a GameObject without a Transform component.
If that AI Behaviour component wants a Transform you have to have a GameObject. Or use a different AI behaviour system. Or perhaps you haven’t noticed the API may have other methods to pass in position and rotation separately?
wont this be performance expensive if I have multiple enemies
Multiple starts at “two”. 10,000+ game objects on the other hand is something to be generally avoided. So how many are “multiple”?
FWIW you will most likely see a higher impact per enemy from the behaviour calculations than for having individual game objects.
1 Like