Align player to normal

Hi people.

I’ve been looking at this BGE constraint actuators “Distance” option
And I like that it can align an object to the normal of what ever plane it’s on. (just what I need)

But once enabled, the player can no longer move.

Is there a way to have the player align to normals, and retain the use of the motion actuators?

Try this, its Blender 2.5


AlignNormal.blend (58.2 KB)

Thank you Josip Kladaric.

I like this, this solution is clean and simple.
tell me, can this be adapted to 2.49a?

My entire project is in 2.49a (because my computer doesn’t run 2.5 very well)
I tried it in 2.49, but the game engine won’t run the script.


I’ve tried to modify the code for 2.49a.

But it still refuses to run the script. (mainly because I have no idea what I’m doing)

Is it possible for this to run in 2.49a?

This is for Blender 2.49


AlignNormal249.blend (34.3 KB)

Thank you so much Josip.

I was afraid that that my blender was too old.
This script has so many applications. This is amazing.

Thank you once again Josip.

If you need anything just ask.

hi, I’m back. And with another question.

is there a way to dampen the effect of the script? (like a gradual tilt as it aligns to normal, instead of this ‘cut’ “I’m aligned this way now” sort of thing.)


I’ve done more searching on damping this script (and I got nothing but e-books that you have to pay for just to look at) and I still need help to dampen the jitter that happens when my object is in-between faces.

Any more help would be much appreciated.


If the cube is the player’s bounding box/physics object, it is usually invisible in the game. Whatever your player object is (rigged mesh) can be slow parented to the bounding box. This will give a dampening in just about every movement.

Thank you gruntbatch.

Funny thing is, by using the slow parent, I unveiled what the real problem is.
I’ve set this up so that script deactivates once the player is not in range.

Problem: The player is using “Track to”. Once the script stops, he flips 360 degrees???
If anyone knows how to fix that, it would be most helpful.

I have the same problem. The object rotate 360º