Character movement help

I’m kinda really stuck right now trying to finish up my standard characters movements. However I can’t seem to keep the character always flat to the ground. I tried using four ray senors around the character to keep him flat. You can see in the video I have four cubes around the character that tells it to move a certain direction when the ray touch the ground but it wasn’t very successful.

https://youtu.be/4_YXlMPduPA

Here is a video so you can see what I’m talking about. The idea was worth a try but it didn’t work. Any ideas would be helpful. This is the only thing keeping me moving forward with my project.

I Guess You already detect ground contact?

If so - shoot one ray down local z and align with hit face normal when having ground contact (assuming You want to do funky stuff like walking on walls).

Simply align after global z when You don’t have ground contact.

You can make the effect smooth with use of angular velocity to reach the right angle.

That should be solid enough?

I’m not following you with the ground contact with hit face…

Send a ray down local z, say 0.5 bu below the character.

If the ray hit something (if You want, something with a certain property) align after the hit normal (You have to use the right ray function to get that, but I have the impression You already do this to some extent the way the character in the video moved over the bridge)

Else align after global z.

I see… sorry about that I didn’t tell you how I did it. Well I’m not very good with python code, I did this with logic bricks. Is there away to do this with logic bricks? I have the cube as ray sensor sending a message to have angular velocity. I understand what your talking about but I couldn’t type that out. logic bricks ftw but I trying to learning the python code but haven’t found a foundation to learn it right. (hit normal)

Wow, I have no idea how to do this in logic bricks. I have part of the solution in my planet gravity VIP (the align to a vector by angular velocity bit). Don’t think the ray part is that hard. If You want I can put a script together sometime over the weekend.

pretty cool. Everything with my character I did with logic bricks. I’m still learning ; I have to learn python to do anything highly complicated.

comixmotion.blend (386 KB)

A small example with a character that align to the ground or global z if it loos ground contact.

Can be controlled by properties without changing the code - name and meaning of parameters in the code.

This is what I’m really looking for! Thanks alot! Now I’m done with the character a move on the level elements. Thanks again.