Hello, how do I access an instantiated Objects INDIVIDUAL SCRIPT COMPONENT, for example. I have 2 cars, one is already in the scene when I press play, one gets Instantiated during runtime, I get the script component of the instantiated car and call its SetDrive(true) method when I approach it and hit the space bar. But BOTH CARS ARE NOW DRIVING when im only trying to control one car. How can I work with an Instantiated objects individual properties which are located in the script that is attatched to that particular object? I tried throwing all the instantiated cars inside of a static arry in the car class, but even when I access the component of the car which is at arry index[0]. All cars are moving when I try to drive only the car which I am close to.
nvm figured it out, the string driveState in my car script was set to static :-/