Built Basic Car-Controller with cannon,three
Keys required to move : W,A,S,D,Spacebar
A bit of drifting supported, will be continuing this one contributions are welcomed
GitHub Repository:
Live Demo:
https://car-controller-threejs.netlify.app/
Built Basic Car-Controller with cannon,three
Keys required to move : W,A,S,D,Spacebar
A bit of drifting supported, will be continuing this one contributions are welcomed
GitHub Repository:
Live Demo:
https://car-controller-threejs.netlify.app/
Nice, but the camara should follow the car and than you can rotate the camara around the car with mouse while driving. Add a button to dock and undock the camara from the car.
Textures would be also nice.
Yes, my next focus is on camera movements, I will use a better car model with textures in the modified one.
Exactly what i need for my troubled car controller, cheers ![]()
Glad to be of some help
Is there a way to prevent vehicle from turning upside down in cannon.js, a lerp function that slowly turn the vehicle upright, not obvious, I observed in most play station and mobile car games, cars are very hard or impossible to turn upside down?
I’ve solved this in the past by having a invisible static body that I position at the car position + some vertical offset, and connecting a spring constraint to a point on the car roof, kind of like a crane. when I detect the car is flipped, a countdown starts, and after a certain amount of time, that spring is enabled with increasing strength over time, to pull the car upright. I think it’s a pretty common solution, and sometimes you’ll see it screw up in some games, if the car is wedged under some geometry, and the spring pulls harder and harder until the car is flung into the air. ![]()