Jump to content
Bloodsong Termagant

My Car Does Wheelies (not on purpose :P)

Recommended Posts

so, i have made vehicles before.  back in the old days.  and i found they drive and stabilize best with an invisible sphere (or spheres) as the base.

 

now this monstrosity is the first mesh vehicle i've created, and i created the physics for it.  and i added my usual stabilizing 'spoilers' to it, but...  this is weird.  when i turn it physical in the build palette, it lands and stays flat.  when i get in it and the vehicle script turns it physical, the front end jacks up.  and, okay, i can see the back end has bigger wheels, and the wedge is wider, so that end is heavier.  but even moving a weight 'spoiler' out front, even bending the back spoilers down so they should hit the ground and force the rear end up...  it still tilts backwards when i try to drive it.  (and the cheese wedge is the root prim, not the spheres.  maybe that's my problem?? :/ )

 

i checked the script for any strange rotation setting when it drives; there is none.  i added a y rotation fixer for when the vehicle comes to a stop and goes non-physical.  and yet... still wheelies.

 

has anybody dealt with this sort of thing before?  what should i be looking to do to fix it??

 

WIP.png

Share this post


Link to post
Share on other sites
Posted (edited)

It would be best if you posted that in the mesh forum. It maybe the way you set the physics up. A simple physics box or two would be all you need for that whatever it is. You can do it inworld with linked physics prims and set your mesh thing as physics none also. The main physics shape needs to be the root prim. I assume it is a block of cheese.

Edited by steph Arnott

Share this post


Link to post
Share on other sites
2 hours ago, Bloodsong Termagant said:

has anybody dealt with this sort of thing before?  what should i be looking to do to fix it??

This is a fairly common problem with models that have a center of mass that's different from the geometrical center.  The parameter to play with is llSetVehicleVectorParam, specifically the VEHICLE_LINEAR_MOTOR_OFFSET parameter.  You'll have to experiment a bit with both the magnitude of the offset and the direction, depending on what your model looks like.  I've had to do this several times to keep the front end of a vehicle from lifting off the ground.

Share this post


Link to post
Share on other sites

You can adjust the vehicle's center of gravity, too. Put the root prim close to the ground and give it most of the mass.

There's llGetCenterOfMass, which you can use to find out where the center of mass is. Remember that the avatars contribute to the center of mass and move the CG. Usually upward, because of the avatar sit problem.

Avatar "sitting" doesn't change the physics shape of the avatar. It's still a tall capsule. The avatar's collision capsule may be hitting the ground when it looks like the avatar is seated in the vehicle. The usual fix is to move the avatar sit point up 1 meter, then apply an animation which moves the visible avatar down 1 meter. This fixes the foot/ground contact problem but raises the center of gravity.  You have to compensate for that in smaller vehicles. A normal sized human avi weighs about 250kg, by the way.  This is very clear for motorcycles, where a rider on the back changes the handling and slows the bike.

Vehicle tuning is a real thing in SL. When I first built a motorcycle, I'd ride around Robin Loop in 4-5 minutes, see what went wrong, pull into a gas station with a rez area, do some adjustments, and repeat. Once that worked, I'd make the big loop all the way around Heterocera, which takes about 20 minutes, noting any problems. I drove about a thousand kilometers in SL before I was satisfied.

Few things in SL use the physics model extensively, but vehicles do.

  • Like 2

Share this post


Link to post
Share on other sites
Posted (edited)

I've had this happen a couple of times in the past, and it turned out to be the avatar bounding box. Raise the sit position one meter and see if it levels out. If so find a driving animation thats closer to  the ground when played from inventory

Edited by Royal Stewart
  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...