|
Hi, I'm trying to pop up an image from OnTriggerEnter with box colider trigger. How do I make it work? I've tried these scripts from an Ben Pitt answer but it won't work: this one on a GuiTexture and then: this script I've puted on a trigger object Can anyone help?
(comments are locked)
|
|
I found out the problem: the GUItexture starts off and it won't turn ON when triggered. But the texture changes.
(comments are locked)
|
|
Try this on the object that collides: You might want to implement OnTriggerExit to turn it off again. Be sure you read this: http://unity3d.com/support/documentation/ScriptReference/Collider.OnTriggerEnter.html If all those conditions aren't met, it won't work. You may want OnColliderEnter instead. Didn't work... I'm trying this code only on the trigger but it still won't work: function Update () { Start(); } var image:GUITexture; function Start() { image.enabled = true; function OnTriggerEnter(other : Collider) { image.enable = false; function OnTriggerExit(otherCollider : Collider) { image.enable = true; }
May 06 '12 at 06:48 PM
ruimobp
Did I read that correctly, that Update is calling Start, and Start is setting image.enabled to true?? Wow. No. You don't need Update here at all.
May 07 '12 at 02:40 AM
DaveA
(comments are locked)
|
