Collision Position?

Is there a way to get the position of a collision?
I tried it with a collision sensor, but that sensor doesn’t have a hitPosition function.

I need it because I want to make a script that makes a ball bounce of walls instead of just damping. I tried it using the restitution method in the material settings, but then the ball goes trough the ground or in the air after a couple of bounces (even with contraints set and gravity set to zero) going over or under the walls.

Thank you

  • Pret_letter

There is no way to get the collison points. For bouncing there is no need for it. Just let the physics do it. It can calculate it much better and faster than you could.
Make the object rigid body, apply some forces and I’re done.

Make sure your objects are not too fast.
And do not use dLoc on physics objects!

Maybe I wasn’t clear what I ment with bounce.
If my ball collides with a wall that has an angle of 45 degrees, the ball should make a 90 degree turn (like when you hit a mirror with a laser). If I collide with the wall using just a motion actuator and a rigid body, the ball doesn’t “reflect” but goes of in a direction almost parallel to the wall.

So it slides. That is normal. The physics simulates mass not light.

I think you can change that with friction = 0 and Restitution = 1 on both materials.