Car and rotation

Hello everyone,

I got a problem with Blender GE.

I’ve got a car, a street and a sidewalk. At this point, everything is fine.

I’m now trying to make it a little bit dynamic and there is my problem.

I’ve got my car composed of other pieces (wheels and so on).

I’ve put Sensors to detect the use of WASD to make it move.

W => Forward
S => Backward
A => Turn the front wheels left
D => Turn the front wheels right

The thing is : how can i make my car going forward when pressing W but with the specified orientation if A or D was pressed ? In other words, how can I orientate my car depending on the orientation of my wheels without moving the whole car when A or D are pressed ? (ie. W = accelerate, S = Decelerate or going backward and the other two just changing orientation.)

Regards,

Noxaeternae

Have a look into the vehicle wrapper, it’s a setup for realistic car physics and will probably sort out your problem.

Thanks for this, it seems very useful.

Unfortunately, i’ve loaded those script and it does nothing. I’ve got my “car” linked with the “wheels” and … it falls on the floor and stay there motionless…

Linked, my .blend.

One thing is the state which I don’t completely understand but i think what i’ve done is close to the tutorial. But where does it fails ?

Regards,

Nox

Attachments

tutoVW.blend (529 KB)

Yeap, thanks for replying.

But it didn’t actually works. Maybe something is wrong with the way I’ve made it.

I’ll delve a little bit deeper on it.

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

check at the left column for 2.6. that you have can be too old

Thanks for replying !

I’ve done some sort of workaround to achieve what I wanted.

Thanks !

Hello !

With my workaround, everything worked as i intended except… One thing.

What i’ve done is a Game Property with the rotation. Left and Right increase / decrease the angle. With a Property Actuator, i check the angle each time i go forward or backward and I apply a rotation based on the property. Everything’s fine with rotations of 0.1 and 0.2 but when i add a third rotation (0.3), it does crash. As long as i stay in the range of -0.2 to 0.2, it works but when i reach 0.3 and I want to go back to 0.2 (resp. -0.3 and 0.2), it crashes.

i’ve got a property actuator which set the property to 0.3 or -0.3 when the property exceed the bounds.

I don’t see what’s wrong …

If someone does, it would be appreciate. :wink:

Regards,

Nox

P.S : Actually, the file seems to heavy to be uploaded… : /