Luke Pierson
Member
Hello all! Got another question. So in my racing game, I have it so that every second the vehicles leave behind tire tread objects, to show where they've been driving, which disappear after a second or so to prevent a drop in framerate.
They work nearly perfectly! The problem though, is that after the race begins, the tread marks seem to eventually lose their spawn alignment and so it looks like there is an invisible ghost car leaving behind tire tracks, typically to the side of the vehicle. The nonalignment tends to occur when the cars turn.
The only car, however, without the problem is the player car, the player's treads spawn right where they're supposed to.
Here's the AI car's code for leaving behind tire treads:
I had it being created at simply x and y, which worked for the player car but not for the AI, so I tried changing it to this. The cars are physics objects, so I figured it would work.
They work nearly perfectly! The problem though, is that after the race begins, the tread marks seem to eventually lose their spawn alignment and so it looks like there is an invisible ghost car leaving behind tire tracks, typically to the side of the vehicle. The nonalignment tends to occur when the cars turn.
The only car, however, without the problem is the player car, the player's treads spawn right where they're supposed to.
Here's the AI car's code for leaving behind tire treads:
Code:
instance_create(phy_position_x, phy_position_y, obj_tire_treads2);