How can i detect is object on my left or right ?

Hi, I’ve got a question.

I have a crocodile for my game; (As you can see below.)
[14913-ekran+alıntısı.jpg|14913]

now i want to shoot it, When i shoot it, It will dissappear (Gameobject.Destroy) and will instantiate on left or right of the screen

So how can i do it :smiley: ? Please Help Me

Before destroying the crocodile object find its’ transform.Position() if x coordinate is less than screen.width/2 its’ on the left else it is on the right. Now based on this info Instantiate on the opposite side.

You will have to send this info to the gameobject that instantiates the croc object.

Hope this helps.