Hi, and welcome! I’m looking for assistance in solving a handful of minor bugs that seem to go in tandem.
Recently I created a thread where a few developers helped me craft my ideal vehicle chassis. The only problem is that it needs to sit multiple people, however major issues arise as soon as more than one person gets in the vehicle. I’ve listed the bugs below along with gifs, I hope these can be solved. I appreciate any and all input!
**Vehicle details: **It’s a chassis using spring constrains, hinge constraints, and weld constraints. The bodykit is welded to the chassis primarypart. The driver’s seat is a classic VehicleSeat object. The other seats are simple parts that the character’s LowerTorso is glued to using a Weld. I have tested this with a normal Seat object and issues #2 and #2 do not exist, however I’m doing my best to use the system I have of normal parts so players aren’t forced into sitting in the vehicle by touching a seat on accident. The gif below is how it moves with only the driver. https://gyazo.com/b8c4b3b7015382a6191c7dd83627c4cf.mp4
A link to the place. It’s free to take. Feel free to use Studio on this place and mess around with things, everything is working the same way it does in my full game, minus the “sitting” animation. Click a neon part to sit.
2.) When another player gets in, the vehicle’s springs give out as if they weigh 100 tons, but the vehicle’s PrimaryPart is a 2x2x2 invisible part with a Density of 100 while a character is light. https://gyazo.com/b20afc1fa9d3fe446a09e17eb2153d0b.mp4
3.) Once another player is seated, the vehicle will only move at a snail’s pace, something like a WalkSpeed of 0.1. The passenger will see the first image, while the driver (and server) show the second image. (The vehicle slowly moves while the wheels stay in place)
Thanks for the response! I’ve updated one of the above paragraphs to include some info about default Seat objects (after some experimenting). Checking “Massless” does not make the issue go away.
Short analysis:
For TL;DR, apparently the main problem is the back seats. When you weld the characters to the vehicle, the vehicle balance become unstable, as if one side is pressed down.
Patching the first problem is to make sure the vehicle doesn’t spaz out on seat by an option: Temporarily anchoring it for a half second(including loose constraint parts) and then un-anchor it, as if the engine is starting up. Only works for the first seat, uncertain about additional players in the back, perhaps limiting the seats to when the vehicle is not moving at high speeds? Then repeat the same trick but shorter durations.
Try switching out the weld from LowerTorso to HumanoidRootPart instead. Accursed animations breaks stuff sometimes. Otherwise don’t.
Not sure what to do when a vehicle is moving extremely slow. I have never tested vehicle building with constraints, maybe I’ll do it one day.
Otherwise, if all above fails, tweak the constraints.
Thanks for the reply! I’ve tried adding the lines below to the script, and even using :SetNetworkOwner in the command line in the Server. Having it in the script seems to have no effect, however using it in the command line fixes the wheel part of issue #3, the wheels stick to the truck.
I’ll set the player to be entirely Massless, but instead of the truck going back to evenly-loaded, the side the player is on is slightly lifted. None of these fixed the snail speed of the truck, however.
@qqtt991 I tried gathering all the parts of the vehicle in a table and then doing what’s in the code below. The wheels stuck with the vehicle, but the vehicle still moved incredibly slow. Setting the passenger to Massless had no effect.
@sircfenner I’ve tried using this line below, but it had the same outcome as what I described above unfortunately.
Just to confirm: your vehicle works as intended when there is only person, but you only begin to experience constraint issues when more than one person enters the vehicle, right?
I’ve never really worked with vehicles so I might not be able to help, but I just want to clarify this much in case some kind of stroke of luck sparks up.
Yes. Having other Seat objects attached to the vehicle seems to fix the issue, but I’m trying to maintain the current system of “click to sit” that I have in the game, where seats are normal parts you can click on, your body is welded to the seat, and you play a “sitting” animation.
Using the HumanoidRootPart seems to solve the ‘stationary wheels’ part of the problem, however it still moves incredibly slow, and the springs are compressed as if the player weighs a ton.
Using a WeldConstraint had no effect other than making the ‘stationary wheels’ issue reappear.
I’ve created a bare-bones version of the system I’m using to “seat” players when they click on a seat part. The link is in the top post, feel free to go in on Studio and mess around.
Looking at the place in Studio, there are several things wrong.
Players sitting in the vehicle can still run, and this is what’s causing the slow movement. Both players are fighting for control over whether or not they’re moving. You should PlatformStand sitting characters, this allows the truck to move properly.
After some testing, forcing the player to PlatformStand after being welded to the seat fixes the issue entirely. Thank you so much for your help with this!