Hey everybody I’ll try to make it short and clear. I’m working on a game where the player is a deer trying to cross roads. I have already managed to get the cars to spawn on the roads, but I want the cars to drive slower or faster, depending on the level.
This is the script that controls car movement -
This is the script that controls the spawning of cars -
I’m trying to communicate betwen the two scripts (newCarSpeed = carMovement.carSpeed;), and I’m doing this because I can’t edit the carSpeed variable found inside CarMovement.cs on each level as I’d like, since CarMovement.cs only exists on instances of the car prefabs.
But my way of approaching this doesn’t seem to work and I’d appreciate any help.
Thank you!