Jump to content

Stick vehicle to ground?


zocken212

Recommended Posts

I've been thinking some time about this and didn't come up with a solution yet. Perhaps you can help me out? Well, I want a vehicle being stuck to the ground, in other words: Instead of flying after you hit a ramp it should stay on the ground. A bit unclear but I hope you will get what I mean.

Regards

Link to comment

First option: I already did this. I increased the mass (or was this wrong? dunno, am not such a handling expert) by a lot and it didn't really have any good effect (except the car being rammed continuously into the ground).

Second option: I tried this as well and it also had not such a good effect for me. I'm setting the vehicles Z velocity to -0.005 every frame and it still floats around instead of sticking to the ground. Maybe I'm doing anything wrong?

Link to comment
First option: I already did this. I increased the mass

Increasing the mass on vehicles does not really change how the vehicle interacts with the world. Atleast not like that. If you want additional info about what mass does, then open this spoiler:

More mass = Makes the vehicle heavier, it does not affect the gravity of the car tho. It also causes a longer distance till the vehicle stops if you let go of W. Also causes less friction, if your car flip your car over (That's what causes that trucks slide across the ground, if on roof) or drive against a wall.

Now back to topic:

IIYAMA's way is the correct way of doing it. I would use a command: it should get the current ground clearance with getGroundPosition and getDistanceBetweenPoints3D. Then you use a timer (or onClientRender); If the vehicle is above the ground clearance that you calculated: push it down with setElementVelocity.

EDIT: Ninja'd.

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...