- Home /
Need Help Calling A Trigger Function
I have one prefab cube that is duplicated twice. These two duplicates are sitting next to each other (touching each other). I want the first cube to trigger the second only under certain circumstances. So the function OnTriggerEnter would not work because I need to place it in a if statement unless I'm missing something. Any help that could be given would be greatly appreciated. Thanks.
BTW, I did try raycasting (shooting a ray after the circumstances were right) but that will not work for my application.
Answer by SrBilyon · Aug 24, 2011 at 08:45 AM
You did make sure to set the box as triggers in the inspector, correct? OnTrigger will only work if so. If you want to, post the code you are using, and explain what type of colliders you are using on these objects/prefabs.
Well, I don't really have any code yet. I can't figure out how to go about it. I need to be able to put the trigger detection inside an if statement rather than having it as it's own function.