# How to get the normal of the face which was hit in a collision?

I would like to make an object stay at the height (Z) and velocity it was created at (it's created from another object with an Edit object actuator). Ideally it should be allowed to bounce up/down, but not allowed to fall (think very slow light ray). I would like this object to bounce off only certain objects.

I couldn't get an object to do this with collision groups + physics (it seems like it should be possible though, so if it is, please say so :)

I thought I would try and handle bouncing with python, however I can't figure out how to get the normal of the face it hits on collision (I'm using a collision sensor with a property)

How can I get an object to behave like this?

Blendfile

• Could you add your blend, I would try to add the ray sensor. But this might take a few days. – stacker May 22 '14 at 20:44
• @stacker Added .blend – gandalf3 May 22 '14 at 21:30
• So far I tried to check the ray sensor independently from the collision sensor it sometime hit, made sure that the orientation (+Y) is taken into account (therefore I messed up the bullet obj). One issue is was the filter configured at the sensors you need a material or property called wall. I will give it another try, pasteall.org/blend/29396 for relfection using the normal see: blenderartists.org/forum/archive/index.php/t-177557.html – stacker May 23 '14 at 6:27
• @stacker Thanks. I do have walls (with a wall property), but they are set to wireframe (and are invisible when the BGE is run). They are on layer 3 – gandalf3 May 23 '14 at 7:34
• In a simpler setup I noticed that a collision is only detected when the Physics Type of the object is set to sensor. Collision bounds are also required (but you have set them as I remember) – stacker May 23 '14 at 13:33

c = bge.logic.getCurrentController()