Collision sensor not working well

Hello, I am trying to make a pinball game in which the player can earn points by hitting bumpers etc. and I am having some trouble with the collision sensor.

I have turned up the physics subframes, and the pinball is bouncing off of the bumpers just fine, but for some reason the collision sensor that I have only registers a hit about every third time or so… I have tried using a touch sensor, using a material, or a property to trigger it, but nothing seems to work. I have experience scripting, so if there is a better way to do this with scripting I may try that.

The ball is bouncing off the bumpers, so the engine is definitely calculating a collision, but it doesn’t always trigger the sensor. I know I have everything hooked up correctly, as it does register some of the time.

If anyone has had this problem, or knows a way around it please let me know! I am using Blender 2.49b, but had the same issue when I tried it in 2.62


-Andrew Miller

This depends on your logic.
If an object is colliding with with one object and the next frame it collides with another object it will not trigger the connected controllers. This is because the state did not state (e.g. from no collision to collision or vice versa).

You can enable “Pulse” at the collision sensor (Touch sensor’s do not have this param). This param let the sensor also trigger the connected controllers when when the collision belongs to a different object (different to the previous frame).

You can also enable “True Pulse” (the upper “…” button). This let the sensor additionally trigger the connected controller if the sensor status is positive (a collision happens).

You find more details at: Sensors a word on Pulses

I hope it helps

I have to admit I’m having a problem with this too. In the game I’m making, what you hit is a big deal. It’s a physics game where you have to gather things for points, but depending on certain properties those things could hurt you. I’ve made a python script to print something every time the objects hit the player. They only fire maybe a 4th or 3rd of the time. Otherwise, they just bounce away whether or not they should hurt you or give you a point. I’ve tried activating both “Pulse” and “True Pulse” and they help a bit but it still happens. Maybe there’s a bug with collision and heavy physics?

Hopefully it’s just stupidity on our part and easy to fix because my game’s broken till I can figure it out :spin:

Hi all, I have the same problem. Collision and touch sensors do not seem to be accurate for transient collisions.
I attached a collision (or touch) sensor to a ball that is bouncing on a cube.
Collision is only detected when the ball stops bouncing and is in a long-term contact with the cube.
During the bouncing phase, transient collisions are simply ignored: the internal sensor state is not changed, the sensor.positive value is not set to one.
I can see the ball bouncing (bullet is working fine) and Logic Steps is set to 5 in the world properties, which means that the sensor should be fast enough.
How is that possible?

Thanks for any help

I just found how to make it working properly !
In the World settings, set Physics Steps to Max:5 and Substeps:1, and set Logic Steps to Max:5
(before, I had Substeps:5 which caused the problem)

This might not be relevant, BUT, it may be of use to you…

When I use property checking either with collisions or rays in Blender-Python scripting, I couldn’t get it to sense objects with the property. But I found a solution.

EX: ray= obj.rayCast((0,0,-100), obj, 0, >>>>>otherobject[‘ground’]<<<<, 1, 0, 0) WORKS
EX2: ray = obj.rayCast((0,0,-100), obj, 0, >>>>>“ground”<<<<<, 1, 0, 0) DOESN’T WORK

Moral of the story: sometimes you have to manually tell Blender what property to look at.
Why? —I’m not sure thoughtful expression

Hope this helps others!