Motion Problems [Solved]

Due to Linear Velocity not playing nice with gravity, I’ve tried to add into my motion script (motion.py) the ability to detect if the player is on the ground, and if not, set the linV to some negative number. This way, I just fake the gravity, which is fine. The only problem is it doesn’t work. I was able to get it to work in a test, but not when I actually tried using it…

I can’t seem to get my “ground” sensor to give off the right triggers. In my two blend files, I’ve set the linV to a positive number so this is easier to see. Also, the ray has a ridiculous range just to make sure that it is too short. I’m using a ray since my terrain is a little hilly, so touch wouldn’t work too well.

I’ve attached the two blends.

This is driving me nuts. Any help would be greatly appreciated.

Thank you,
Moguri

Attachments

broken_motion.blend (517 KB)motionTest.blend (136 KB)

Here you go:
http://www.savefile.com/files/1613854

WSAD moves the player, space jumps… 100% python free.

it is sliding around really easy because I turned off the material friction,

also i used the sphere bounds, so it can climb up stairs and hop over small obstacle’s.

If this helps you out, please try my exploding duck demo :slight_smile:
http://blenderartists.org/forum/showthread.php?t=127588

This looks like it might help. However, I’ll probably just convert the stuff to Python becuase that is just what I prefer (I have nothing against logic bricks, I just prefer to code the stuff…). And I saw you’re first demo with the ducks, it was cool. Maybe I’ll check this one out too.

EDIT: Yup, this worked (with Python too). Thank you. I changed the title to [solved].