If I wanted to change the initial position of the car, how would I do that? I’ve tried adding carFrame.position.x = carFrame.position.x + 1; as the last line of CreateCar() but that doesn’t seem to have any effect.
I’d like to try this out on some external models, which is why I’m looking to update the initial position.
Hello, you have to set the disablePreStep property to false on each physics body before changing the cars position. Here is an updated playground with this implemented PhysicsV2 Car Simulation Example | Babylon.js Playground
Pressing “r” triggers the Reset() function which moves the car back to the start of the track.
Your game is looking great so far - feels a lot more fun than the original playground for sure! I ran it with the headlights and tail lights enabled but it ran totally smoothly on my computer so it’s hard to pin point any problems.
In theory these should help though:
Swap the pointlights for spotlights (setting the angle to 120 or less ideally)
Removing shadow generators from the tail lights (you would probably barely see the shadows these generate anyway)
Reducing shadow generator texture size
Hopefully that can get it running better on your machine!
Only the lights seem to have no effect at all at the car (light reflections/lightning, just like in your video), only all the other objects, but i think after that, it is a really cool playground example (updated code is in the github repo)