Hello,
so im currently working on a parking game. The goal is to park cars in a car park. To increase the fun, i added different cars, so far so good.
Then i decided, it would be more fun to have the cars to steer appear in a random order and that’s where problems started. After hours of trying, i managed to create an array which is randomly shuffeled by the ArrayTools Extension. To spawn cars, i used the following expression:
The spawn works fine so far, but i can’t adess the car i spawned because its one random car between PlayerCar1 to PlayerCar5. GDevelop doesn’t accept that the name of the object is:
“PlayerCar”+VariableString(CarSpawn[0])
Is there any way to work without a “PlayerCars” Group?
Because when the car was parked, i used to just go to the next car to park it.
Now, i have to delete the car and spawn a new one, which is outside the “PlayerCars” group (to let the parked car stay in the parking lot, signalizing the parking lot is blocked). This is not that easy because when i spawn the new car, the position and angle is wrong. Its just so much more work to do.
Is there any way to use the expression (“PlayerCar”+VariableString(CarSpawn[0])) as the object name or a number (object variable?) or something like that?
Thanks a lot!