Hey,
I've been trying to let a car drive down a road, for this it will check if there is a road around himself. The idea is: Click the car -> Click location. Now it should drive towards that point. The problem is I've got 3 cars. (3x Car.class).
Now when I click car 2 and 3, it will not follow the road. When I select car 1 it will work as intended.
For some reason it will use car 1 to run the getOneObjectAtOffset.
The way I have used my Offset :
Actor roadLeft=getOneObjectAtOffset(-1,0,road.class);
So I guess it uses this as:
For Car 1:
Actor roadLeft=getOneObjectAtOffset(-1,0,road.class);
For Car 2:
Actor roadLeft=getOneObjectAtOffset(Car1.x-1,0,road.class);
For Car 3:
Actor roadLeft=getOneObjectAtOffset(Car1.x-1,0,road.class);
My question:
I have written:
Actor roadLeft=getOneObjectAtOffset(-1,0,road.class);
Why does it read it for car 2 and 3 as:
Actor roadLeft=getOneObjectAtOffset(Car1.x-1,0,road.class);
And how can i fix it?
Thanks

