so im making game and i will add missiles that will be randomly generated as the game progresses and i was wondering how can i make it so the missiles move towards the player ONLY if they are in the camera frame. any help would be appreciated and please feel free to ask me for more details.,So im making a game and i will add missiles that will be generated as the game progresses and i want the missiles to only move towards the player if they are in the camera frame. Any help would be appreciated and please feel free to ask me for more details.
How about using a collider configured as a trigger? Set it as a child of the camera so it always moves and stays frame size.
Then encapsulate your move towards player code on the missile under a OnTriggerEnter() function?