Giving control to a product

Hi,
I’m beginning in Unity, so I would like some help please.
In my application I control my camera like in a fps game and i want to manipulate some object like in a point and click game where you look at different angle make it rotate with your keyboard key.
I use the keyboard keys for my character with the update function to make him move when I want to manipulate an object I block the update of the character with a flag to use the update of the object that I have selected.
All this work but I have 1000 objects on the screen so the update is killing my application performances.
I tried to use a while loop with the onclick event but I get an infinite loop :s.

Move the per-object update code into a differently-named method, and make make your player object’s Update method call through to whichever object is currently selected. That way the other objects are all passive.

Yea that’s nice I’ll try it thank you.
By the way what is the best.
Using static variable or stocking a variable “objectInUse” in the player script that will be accessed by camera.ObjectInUse (something like that)?

It depends how the data is accessed. Is it intrinsically global data - do other scripts ever need to access it, either read or write? If not, then don’t make it static. What would you do if you had two, or more, players? If you decide not to care about that, but other scripts do need access, then static may be a good choice, especially if the other scripts that need access would otherwise have to search the scene for the player object. If the other scripts already know which is the player object then it’s not hard for them to query it directly.