Messages on multiple collisions #39493

Closed
opened 2014-03-28 20:41:48 +01:00 by Richard R · 4 comments

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?

bge_collision_msg_test.blend

**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? [bge_collision_msg_test.blend](https://archive.blender.org/developer/F83265/bge_collision_msg_test.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @remnar

Added subscriber: @remnar

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Angus Hollands self-assigned this 2014-04-30 21:42:05 +02:00

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.

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 ](http://www.blender.org/documentation/blender_python_api_2_70_4/bge.types.KX_TouchSensor.html#bge.types.KX_TouchSensor) or read the number of messages in the subjects attribute of the sensor.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#39493
No description provided.