Collision info should contain references to collided objects. #9787
Labels
Feature request
Issues that request the addition or enhancement of a feature
@ Script API
@ Server / Client / Env.
Problem
Recently, the on_step function has a new argument, the collision info. It's nice but one serious thing is missing. When the object collides with another object, it only receives that it has collided with A OBJECT but it doesn't get any information about what kind of object it is. It is quite common in games that colliding with different objects has different results. For example, when an arrow hits an animal, it should damage only the hit animal. If you do it vice-versa, the animal has to know somehow that it was hit by an arrow and not by a different object. Currently, there's no way to do this in any of those two ways.
Solutions
Add a reference to the collided object into the collision info.
Alternatives
I don't see any alternative solution here.
Additional context
SuperTux :D https://github.com/SuperTux/supertux/blob/master/src/collision/collision_listener.hpp
EDIT by SmallJoker: Fix link.
The text was updated successfully, but these errors were encountered: