About collision response messages (SOLVED)

I understand that they are only sent to components inside the same game object.

But the way my game objects currently work in the collection, I can’t really put the collision component into the same object as the script I’d like to handle the collisions (and also not the other way around).
So a workaround I’ve done now is that there’s a tiny script doing nothing but receiving the collision response message and passing it over to the script (which is in the parent object).

image
Red is the smol message-forwarding script, blue is the big one.

Is there a better way to do this? Or am I just stuck with using small scripts to handle the collisions in the child objects?

Looks like a mistake in design, but we can’t suggest anything unless given more information about your object hierarchy and what those scripts in particular are trying to accomplish.

2 Likes

Unless you can move the weapon_col object to the same game object as your player script then no. Depending on the number of collisions per frame and number of objects it may or may not be a problem.

1 Like

Alright. Though, in what case would you say would it be a problem?

I can’t say for sure, but I’d guess that if you have 1000 collision objects that collide every frame it would almost certainly be a problem. It would probably not be a problem if it is 100 objects. And definitely not a problem if it is less than 50.

The only way to know for sure is to test it yourself.

1 Like

Then I guess for me it won’t be a problem, I doubt there will be more than 10 collision objects at a time. Thanks a bunch!