hi…
im having trouble to detect collisions of 2 objects with a camera…
let me illustrate…
i have 2 objects A and B … and a camera…
when A and B collide it triggers the camera to do something like move, zoom, etc…
- the camera detects the collision (my guess is raycasting).
how can this be done…??
ok…
i’ve found the solution…
anyway…
thanks for your patience…
so… here’s what i did…
in the trigger function…
i put in a variable for the camera…
next thing i did was…
in one of the objects (A) which contains the trigger function…
so…
here’s my snippet solution…
function OnTriggerEnter(other:Collider){
var cam : Camera.main;
if(other.gameObject.tag == "B"){
//something happens to B
cam.GetComponent(objectScript).Something();
}
}