enabling / disabling..

enabling / disabling..

PostPosted by pyratej » Wed Jan 01, 2014 3:08 pm

Hello, I have a multi-state scene that requires the visualizer and its effects to be turned on/ off. Currently i've tried to disable the "VizManager" which seems to work for the most part except it seems that some of the triggers keep running.

At this point i'm stuck here:

Code: Select all

for (cube in cubes){
   cube.GetComponent("VisGameObjectPropertyTrigger").enabled = false;
}



Error:
BCE0019: 'enabled' is not a member of 'UnityEngine.Component'.

Notes:
- This is being called from a .js script
- Script comp order doesn't seem to be the problem.

Any thoughts?

I'm lost.

Thanks,
Jason
pyratej
 
Posts: 1
Joined: Wed Jan 01, 2014 3:02 pm

Re: enabling / disabling..

PostPosted by AlteredReality » Fri Jan 03, 2014 12:15 am

I've not tried disabling them to be honest. I don't use JavaScript, so I'm not sure of the correct way to disable it from JS. However, the "enabled" property is only on the Behaviour, not on the component:

http://docs.unity3d.com/Documentation/S ... viour.html

So I'd assume you need to access the object as a Behaviour, not as a Component. I'm just not sure how to do that from JS.

Also, have you tried disabling the VisManager GameObject, and not just the component?

Let me know if any of that helps.
Andy - Altered Reality
AlteredReality
Site Admin
 
Posts: 118
Joined: Fri Jan 06, 2012 8:31 pm


Return to Questions and Discussion

Who is online

Users browsing this forum: No registered users and 1 guest


Style by Gokinstudio | Free forum hosting by ProphpBB | Software by phpBB | Report Abuse | Privacy
cron