Jump to content

Set vehicle velocity


Recommended Posts

I am in the midst of designing an Engine and Transmission simulation for a game mode i'm developing. Starting out i know i need to figure out how to make the vehicle accelerate, at the wheels.

By using setElementVelocity, you would get a very unrealistic outcome. Accelerating the vehicle based on the motor specs, vehicle weight, transmission ratios, throttle position, and some physics, then setting the element velocity would be a good idea. But what about when you go over a ramp? You are mid air, still accelerating, going faster, because your throttle is down. In a real life situation, once the wheels leave the ground, you stop accelerating (physically). So i need to use something other than set element velocity.

Another situation, is when you are behind another vehicle. Hitting the vehicle would cause some resistance against the acceleration, but using setElementVelocity would act as if the sports car was a AM General with a 14 liter motor, pushing through anything it pleases. As the vehicle would hit that velocity, no matter what.

I need a procedure that allows me to accelerate the vehicle to a speed i want, but slow from outside forces, and not get any faster once the wheels have left the ground.

It seems to me, if i use the setElementVelocity route, ill need to check for much more and do much more calculations per frame to simulate collision response, and distance from the ground. Any ideas?

Link to comment

Well you need to use "sensor" check's.

isVehicleOnGround -- if it's false you are in the air so you stop/ change the Velocity value 
onClientVehicleDamage -- this 2 can be used to check if you hit something ( a car in front of you ) then again change Velocity value to make that resistance effect , etc ... 

Link to comment

I used an alternate set of procedures for a more realistic approach, made this a lot easier than i thought. Changing handling would be an amateur way of doing this, forcing a lot of communication between the server and the client for what im wanting (and have finished) completing.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...