how to applying force ??

hey
i been trying to make a simple car game using a tutorial from www.tutorialsforblender3d.com and i finished it but each time i press p or go to the game menu the car does not move except the front tire when i press the left and right arrows .and at the begining of the tutorial it says

note
The car’s object center is the center of gravity.
Force is applied to the tire’s object center.
A car with a high center of gravity will ‘pop a wheelie’ every time you step on the gas.
it shows a picture .if it helps
how do i apply force ???

tutorial page
http://www.tutorialsforblender3d.com/Game_Engine/Vehicle/Vehicle_2.html

sorry but i cant upload the blend file so you can take a look at it.
how do you apply force
please help!!!

Having had a quick look through the tutorial, I’d say you need to apply forces to the wheels using a simple motion or servo actuator.

hey
thanks for your help but what you mean by simple motion or servo actuator ?
im just a begining so …
well thanks for your help FunkyWyrm

and heres the blend file so you can take a look
http://www.filefront.com/14066745/N.F.S.U.C.blend
so you can understand what a did
nfsuc =need for speed under construction (if you where guessing the name )(and the car is no mines its from the web) i can make cars but i just wanted to make a game soon

and if you know how to add speedometer ,map and other things a car game has like in need for speed game’s please tell me how or if you know a tutorial tell me.

lil city,

To make your car move.

The problems that you are having are caused by the changes you made to CarSetup.py.

Suspension angle.

This is the angle the shocks etc hang from the frame of the car. You have set the suspension angle to be [ 0.0, 0.0, -0.005]. (To be honest I don’t know if that is an real angle.)

Change it to the minus Z-axis of the car.

CarSetup.py lines 145 - 148


    # suspension angle from car object center
    tire_0_suspensionAngle = [ 0.0, 0.0, -1.0]   # front driver's tire 
    tire_1_suspensionAngle = [ 0.0, 0.0, -1.0]   # front passenger's tire 
    tire_2_suspensionAngle = [ 0.0, 0.0, -1.0]   # rear driver's tire 
    tire_3_suspensionAngle = [ 0.0, 0.0, -1.0]   # rear passenger's tire 

Tire axis attached to axle

This is the axis of the tire you want to attach to the car. You are attaching the tire axis [ -0.005, 0.0, 0.0]. (Again, I don’t know if that is an real angle.)

You want to attach the tires using the X-axis.
Use either the positive X-axis [ 1.0, 0.0, 0.0] or the negative X-axis [ -1.0, 0.0, 0.0] depending on how your tires are textured and if the force applied to the tires is negative or positive.

Attach the tires to the car using the positive X-axis

CarSetup.py lines 157 - 160

    # tire axis attached to axle
    tire_0_Axis = [ 1.0, 0.0, 0.0]   # front driver's tire 
    tire_1_Axis = [ 1.0, 0.0, 0.0]   # front passenger's tire 
    tire_2_Axis = [ 1.0, 0.0, 0.0]   # rear driver's tire 
    tire_3_Axis = [ 1.0, 0.0, 0.0]   # rear passenger's tire

Tire radius

You have the tire radius set to 0.01. The actual radius of your tires is 0.1485.

Change the code (lines 120 - 124) to the following

# tire radius
    tire_0_Radius = 0.1485   # front driver's tire 
    tire_1_Radius = 0.1485  # front passenger's tire 
    tire_2_Radius = 0.1485   # rear driver's tire 
    tire_3_Radius = 0.1485   # rear passenger's tire 

Make those changes and your car will move.

There are other things that you need to change (tire/car scale and car object center to name two) but it could be that you just haven’t gotten to them yet.

Clark

hey
thanks cthames for begin 2nd to post and FunkyWyrm . well i did the change and cthames was right i finally made my car move and now i have to continue making it better or what ever it needs

if you have any other ways to make it better or anything you think is wrong or needs so adjustments please tell me

hey
cthames thank for you help

hey i think is solved on problem you saw .the one where the wheels are facing inside left side.

first click the tire that is the other way
then transform properties (n key)
in rot z change 0.000 to 180.967 (for back wheel )and front wheel 180.567 (that number is the number that the other wheels on the right are using but negitive )
and then while having a wheel selected press ctrl + a and select rotatrion to obData
and done!!!

well i think you saw a ploblem so there it is so you dont get complicated

if you dont understand please ask me to exlpain it better

hi lit city,

Glad to help.

The problems that I was talking about was the scaling of your car and tires and the location of your car’s object center.

You have/had the scale of your car and tires at 0.01. Except in special cases, the scale on all game objects should be 1.0. Not having it at 1.0 can cause problems with parenting, replace mesh, etc. Best to avoid it.

The location of your car’s object center is below the mesh of the car. For a race car, place the object center at the same height as the tire’s object center. Adjust the suspension height to raise or lower the car. Force is applied to the car using the tire’s object center and uses the car’s object center as a pivot. A car with a high object center will pop a wheelie when you give it the gas. A car with a low object center will try to force the front end into the ground.

For a high polygon car model like yours, a collision box is a good idea. Using the high poly model for collisions will cause a drop in frame rate each time it collides with something. Make a low poly collision box and use replace mesh. It will look the same and the frame rate won’t drop.

Another thing you want to keep in mind is the size of your game objects. The default is 1 Blender Unit = 1 meter. The game engine physics is based on this. Collision margins, gravity, etc. Doesn’t have to be exact. If you use 1 Blender Unit = 3 meters or 1 Blender Unit = .2 meters, it won’t make much of a difference. You probably won’t be able to tell. 1 Blender Unit = 1000 meters or 1 Blender Unit = .001 meters, that will make a huge difference in the physics.

Clark

hey

 well to continue on with the game how can i make the speedometer ,menu ,and them other thing a car game has so you can know speed and other things of the car?