I finally figured a way to make the wheels stick to my vehicle while turning, and also have the wheel’s physics not interfere with the vehicle’s physics by using Ctrl+J and joining them together.
I’m now having a different problem, though because I’m not sure how I can animate the wheels. If I were in object mode and each wheel was selectable then I could assign a logic brick to each individual wheel to make it turn, but because I joined the wheels with the vehicle’s body, I’m not able to assign logic bricks to them in edit mode.
Never done something like this, but my idea would be Armature - One bone for each wheel, paint them in weight-paint and turn them as an animation.
But shouldn’t it work with parenting the wheels with the car?
If you join the wheels with Ctrl+J to the car, the result is one object, so you can only add one physic and one logic briks. If you realy want to do it in logic briks try to add the weels with the constrain actuator. But I think it is better to use a python script. Here you can find a tutorial http://www.tutorialsforblender3d.com/Game_Engine/Vehicle/Vehicle_2.html.
hundi, I tried parenting the car to the wheels but the wheels had trouble follwing it whenever it turned. I like your armature idea, though. I’ll try it and report back.
HG1, I’m using Blender 2.55 right now and the python script in your link doesn’t work on it. Besides, I’m aiming for realism and its crucial that the tire physics don’t interfere with the car physics and have good collision detection, so I don’t mind combining them into one object.
Oh, and I’ve also tried using shape keys to make the individual wheels turn in edit mode but that doesn’t work either. It seems that shape keys only have the ability to affect an object’s shape, lol!
I’ve also tried animating the tires manually instead of using logic bricks , but it seems that you can’t insert key frames either in edit mode, in order to move the tires.
If anyone has a simpler method than using armature, then please share it.
these are very useful…a little misguiding though.
When i was opening up the “camaro 2.5x.blend” i was hoping for a mid-poly camaro model, but damn
the actual model blew me out of my expectations!
Alright after a lot of trial and error, It doesn’t seem that joining the tires and the car itself into one object was the best solution, since it created a lot of unforeseen problems.
So far I’ve attached a single bone to a tire, weight painted the tire, made the tire the parent of the car and then added a motion actuator to the bone, but that moved the whole car even though I only weight painted the tires. After that, I animated the tires and then used an action actuator to run the animation, it worked but the car is now parented to the bone which means that there still will be physics interference between them!
HG1, thanks for the links. I’ve actually done a lot of googling before making this topic, and only the Racer25.zip file was known to me before you posted it.
I wanted to make a car with good physics without python but it seems like there is no escaping it. It’s not so bad, though cause now know I have a lot of source code to aid me :yes:
Append your car in my old VehicleFinished_25x.blend.
Scaling the car a little bit up to the size of the original car.
Press CTRL+A and apply the scaling (for the physic the scaling must be x:1.000 y:1.000 z:1.000).
Select the new car then shift select the old car (with logic bricks) then press space key and type in Copy and select Copy Logic Bricks to Selected.
Change all physic attributes on the new car (Rigid Body, No Sleeping, Mass: 200.000, Damping Translation: 0.032, Damping Rotation: 0.188, Collisions Bounds, Convex Hull)
Set up the tire position.
tire_0_Pos = [ -1.7, 2.9, -0.5] # front driver’s tire
tire_1_Pos = [ 1.7, 2.9, -0.5] # front passenger’s tire
tire_2_Pos = [ -1.7, -3.0, -0.5] # rear driver’s tire
tire_3_Pos = [ 1.7, -3.0, -0.5] # rear passenger’s tire
That was all.
Just look at the Vehicle Wrapper for non programmer.
There is no need to even touch the python code.
There is no need to write down the position of the wheels.
Just editing some properties - maybe editing some LB to customize the controls.
It should be easy to adapt it to your model.
Will this setup be good enough to get my game working with AI and network playing ?
It is a basic car physic setup. If you want a more realistic car physic you can change some values like Tire_Grip, Suspension_Compression, Suspension_Damping, Suspension_Stiffness, Roll_Influence and so on.
It the same like Monsters vehicle wrapper. But Monsters vehicle wrapper is a little bit easier to setup, it use only one value for all wheels. For the other vehicle wrapper you have to change it for each wheel.
Both methods basicly accesses the VehicleWrapper which provides an easy API to a vehicle physics model.
For drifting and spinning, you should play with the friction parameters of the wheels. I think there are a lot of params to play with. You need to find out what setup fits best for you. You can even create cars with different behaviour.
BTW. mass and center of the vehicle object has influence on the car’s behaviour too!
Ok, thanks for the info.
I’ll try and see what will work best for me.
I still want to learn python so I can make my own custom setups etc.
But I guess it’s gonna take some time.
At the moment as HG1 converted my car to be drivable, it rolls over when turning at high speed. How can I change this ?
I assume the rear wheels give to much power under the vehicles center. Try to lower the center or reduce the forces on the rear wheels. There might be other solutions, but I do not know them.
Thank you. I got it.
Now I can start to see how the python script stuff works.
Do you perhaps know how I can make my car’s front wheels spin as if I’m pulling away too fast like in drag racing ?
And what about picking up something you drive over which gives you a nitro’s boost ?