- Home /
Duplicate Question
How to check is object colliding multiple times in one frame
I need to put an object (a trigger) in multiple positions and check if it is colliding. I have a function called in FixedUpdate that calls a function from the trigger object that returns is OnTriggerEnter runned or not, but this doesn't work. I need to do this for about hundred times. Do I need to use a frame for every check?
Answer by CJGames · Dec 12, 2014 at 05:23 PM
I'm not american and my english is not very good, but i think what you want is "OnTriggerEnter" or OnCollisionEnter" so if you want to check if something is colliding you should do something like this (java):
var isColliding : boolean;
function OnCollisionEnter (collision : Collision){
isColliding = true;
}
function Update(){
if(isColliding){
//something happens here
}
}
I didn't checked if the code is correct so if there's something wrong just call me i'll try to correct and also i think this helps :D (not sure if this is what yur asking)
No, I said I tried that and it didn't work because it probaly updates once per frame. I'm not american or english either, I'm from Finland.
Follow this Question
Related Questions
Is there a way to determine if an object is within a trigger, from objects perspective? 2 Answers
Physics Possibilities?: Angles, Penetration, Exceptions 4 Answers
Collission and Trigger on Same object 0 Answers
Get All Renderers inside of GameObejct 0 Answers
Is it possible to combine child trigger of a object to only trigger OnTriggerEnter once? 1 Answer