Download

Spawning effect e.g. sparks on collision between actors of the same class

Hello,

if I have two actors of the same class and they collide, both will fire the hit event. If I want to spawn a collision effect, e.g. sparks, what is a good way to avoid spawning them twice (in each of the both actors)?

Thank you,

Thilo

Is it a good idea to use the unique ID for that? Meaning if actor A collides with actor B, in both hit-events check if the ID is smaller (or greater) than the other one. If yes, spawn the effect. It will always be in one actor smaller, in the other greater. So only one actor will spawn the effect. Can I use the UObjectBase::GetUniqueID for that?