Page MenuHome

Messages on multiple collisions
Closed, ArchivedPublic

Description

System Information
Windows 7, 2.4ghz celeron cpu, 2gb ram, Geforce 8400GS

Blender Version
2.69 and 2.7

Short description of error
Message sensors that receive the same message from multiple collisions at the same time, where their collision sensors are hooked to message actuators, are only sending a single pulse to the actuator.

I am not sure if this is a bug or if there is something I am missing. I know that if I swap the mesh on collision, that happens on all accounts of a collision per object regardless if the collisions occur at the same time. However, if I send a message on a collision, the actuator hooked to a message sensor is only triggered once.

I included bge_collision_msg_test.blend to prove this. The problem is also in blender 2.69. It'd be better to open it in version 2.69 where material swaps work properly. Open the file and run the bge, then take note of the debug property. When the sphere collides with 2 boxes, only 1 of the messages is sent to the actuator, as can see the value of "prop" being set to 1. If it worked the way I expect it to: it should have been set to the value of 2. I first tested it using actuators; then I tested it using python with some additional unique information (object name). Using the additional information did not help.

I thought the problem could be solved if I introduced a randomized timer before the call to sendMessage; but, it is not working even with a large timer. I looked at the console window after running the bge, and I can see that it is printing 2 different sets of values from the timer; but, the message received on Cube.002 is still only setting the value once. After another test, it is receiving both messages. I set the Message sensor to hook to a python script: print(cont.sensors['Message'].subjects), and it prints to the console: ['ishit', 'ishit']. So why is it not triggering the actuator to add 1 to the prop value, twice?

Event Timeline

Richard R (remnar) raised the priority of this task from to 90.
Richard R (remnar) updated the task description. (Show Details)
Richard R (remnar) edited a custom field.
Angus Hollands (agoose77) changed the task status from Unknown Status to Archived.Apr 30 2014, 9:42 PM
Angus Hollands (agoose77) claimed this task.

This isn't a bug. It's a design of the system - logic brick sensors are only triggered once per update. If you want to handle multiple collisions, iterate over the hitObjects or read the number of messages in the subjects attribute of the sensor.