I’ve been experiencing a host of probably related bugs with my car chassis including:
-
The vehicle disappearing approximately 1 second after being created if no player sits in the vehicle seat. There is no code to even check for the presence of a player in the seat, or to delete the car except via UI button. In Test In Window the parts of the vehicle are instantly destroyed, however their containing models are not destroyed, even if said models are now empty.
In a live server, the vehicle will disappear after about 1 second most times, followed by a black part, presumed to be the vehicle, briefly obscuring the camera, usually followed by the vehicle reappearing in its original location. The vehicle suspension is no longer functional, but I cannot find a reason why, the script otherwise functions normally.
If the player enters the vehicle within a second of it spawning, it will function normally.
This will not occur if the vehicle is anchored or suspended off the ground.
This will still occur if the player subsequently leaves the vehicle again.
This will still occur if the vehicle seat is removed from the chassis and the code edited not to use it.
https://youtu.be/Jl-I8tjsX0A -
If the vehicle reappears after the above, entering the vehicle’s seat and exiting results in the players character becoming invisible.
https://youtu.be/xlvaO3eWbR0 -
While the vehicle is functional, the center chassis block sometimes flips 90 degrees and floats away from the rest of the vehicle for a split second - despite the fact that the vehicles body, seat and wheels are all welded to this block, and that the vehicle otherwise behaves as if everything is normal. This generally happens during sudden frame rate reduction.
What I’ve been doing to try and find the problem:
- The car is the only scripted element in the game
- The car’s network owner is set to the player who spawned it
- There is no code in the game (including the car) which sets the CFrame of anything apart from the spawner, which is comfirmed not to trigger after the initial spawn.
- There is no code in the game which sets the velocity or rotvelocity, or position, or size of a part.
- There is no code which calls :Destroy() or :Remove() except for the aforementioned spawner.
- There is no code to manipulate the character, camera, or change transparency.
- The parts of the script which changes the weld offset of parts (Such as the wheels and trails) have been disabled, to no effect
- The car is moved entirely by BodyThrust objects. Printing the force of every body thrust every frame does not result in any anomalously high values at any frame
- The input from the player given to the car is not anomalous (All values between -1 and 1)
I cannot think of what further steps I can take, I’m finding this behaviour pretty much inexplicable and don’t know what I can do to fix this other than by sacrificing functionality and stopping the car running entirely without a player in it.