Can GE physics do this?

I want to propel a vehicle at a fixed speed with a single keystroke. For example, I want to use keys 1, 2, and 3 to have my vehicle move slow, medium and fast. The only examples I’ve found only apply a force while the key is held down. As soon as you release the key, the force is removed. I’m hoping to use physics for this, that way I can take advantage of all it’s other capabilities.

Any advice?

use linv

I’m experimenting with “linV” “L[ocal]” and “add” to get the results I want (accelerate/decelerate to a desired speed). That works fine.

But when I try to use “angV” or “Torque” at the same time I get wierd results. What I want to happen is for my vehicle to accelerate/decelerate its -turn- as well.

Another solution would to do this:

Set properties combined with the “always” sensor to set the motion.

I photoshopped the controllers to make the conecting-ness easier to see

Thanks Chaser, that’s exactly what I was looking for!

I took your example and now have a vehicle that I can drive forward and reverse (at a controled speed), perfect!

Now my next obstacle is that I’m using “Torque” to turn the vehicle, but it turns even if the vehicle isn’t moving. Is there a (preferably easy) way to check if the vehicle is moving before allowing it to turn? ie. only allow “Torque” if vehicle is moving? And even better: set the amount of “Torque” based on how fast the vehicle is moving, ie. that faster the vehicle is moving the faster it can turn?

Another question: How come this doesn’t work when I turn on “Bullet Physics”? Only seems to work with Sumo…

just attach an uparrow sensor to the the turn sensors

Ok, I’m a complete newbie to Blender GE so I may not be understanding you here. I’ve set up the forwards/backwards “Force” as shown by Chaser. So when the “1” key is pressed, “Force” is appied and continues to be applied until another key is pressed.

I’m guessing that I need to either:

a) have a way to check the vehicle’s speed, and then scale “Torque” based on what the speed is. Or,

b) check for the value of the “Speed” property. If “Speed” equals “0” then “Torque” will equal “0”.

Unfortunately, I’m not sure how to do either…

Here’s a copy of my blend so far:

sorry. I didn’t read your whole post. I was assuming you were using uparrow to go forward.

but now i understand. Here i made a .blend file for you. Is this what you’re looking for?

Thanks Clone Dadd, but for some reason I’m not able to download the file. I’ve PM’ed you.

Thanks again!

I didn’t get the PM :-?

… sorry, I sent it to your email address at Yahoo. I’ve PM’ed you (here at elysiun) with my email address. Thanks very much for creating the sample, can’t wait to see it! :wink:

Sorry Clone Dadd, my mistake. I was able to get the file after all, I didn’t see the “fine print” at the bottom of the screen… oops! sorry!

Took a look at your sample… cool! Easier than I thought! So I could use other “Property” logic blocks so the turning force is less for lower speeds. That will work for now.

What I’d ideally like is to have it based on the vehicle’s true speed. I think I’ll find that info in one of the “speedometer” samples I’ve seen.

I’ve got some learning to do! Thanks again!!!