Is there a way to find out what triggered an event?
I’m having a problem when a player fires a weapon where the projectile travels the distance between the end of the weapon barrel and the target, the player is immediately teleported by the last teleporter they used. What makes this difficult to diagnose is that there is absolutely no connection between the weapons system and the teleporter system. Yet, the moment when the projectile is added to the workspace, the teleport is triggered.
At this point, I’m not sure if it’s something in my code or if there’s a bug in the engine.
EDIT:
I forgot to mention that with debug.traceback()
, it will only go back to the event connection and it will not tell me what triggered the event. However, the hitpart from the Touch event is always HumanoidRootPart or Handle when this happens, so I’ve developed a workaround to deal with it. But I would really like to know what the problem is.