In my game I have it to where players can spawn a vehicle via a chat command like so: /rc for RaceCar
The problem occurs when spawning multiple vehicles at once. I’ve wrapped my head around the issue being tied to Ammo.js not being able to depict the vehicles from one another.
Below are some GIFs displaying the above behavior:
Upon entering either vehicle instance, control of both vehicles are lost and never regained. You can see the vehicles taking input controls, however it no doesn’t move.
Upon re-entering a single vehicle instance, control of the vehicle is lost and never regained. Again, input controls are working yet the vehicle refuses to move again.
This is the PlayCanvas Example used for the Vehicle Implementation, which is based on PlayCanvas Buggy Example.
Your example works but they should work seperately from each other’s controls, it may be because I have a variable called ‘inVehicle’ which depicts if the player is in the vehicle or not.
I believe the value passed here is passed to the other vehicle.js scripts, I need to make changes to were it works independently.