Scripting Threshold - VisTargetTrigger

Scripting Threshold - VisTargetTrigger

PostPosted by kurthollowell » Fri Apr 25, 2014 12:49 pm

I've noticed that the threshold's for VizTargetTrigger sometimes need to be adjust for each song. I'm using Visualizer studio to make a music based game where players can load their own songs, and have it affect the game. I need to be able to adjust the Threshold value for VisTargetTrigger via a script to set it to the appropriate value for each song. Does anyone have an idea on how to do this? I tried just editing the script, but the values all seem to be embedded in xml, I'm not sure how to access them.

Thanks,
Kurt
kurthollowell
 
Posts: 3
Joined: Tue Apr 01, 2014 3:29 pm

Re: Scripting Threshold - VisTargetTrigger

PostPosted by AlteredReality » Sat Apr 26, 2014 11:30 pm

You need to set the "triggerThreshold" on the component (which is located in the base class VisBaseTrigger).

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

Re: Scripting Threshold - VisTargetTrigger

PostPosted by kurthollowell » Sun Apr 27, 2014 9:32 am

Ok, I've found what you're talking about. But it seems that the VisBaseTrigger class is defined in an xml doc. It seems like the triggerThreshold variable is only defined in the xml. Am I missing something? Or is there a way to get public data from another gameobject and set the triggerTreshold from within the xml? Something like triggerThreshold = GameObject.GetComponent<Script>().value;

Thanks for the quick response
kurthollowell
 
Posts: 3
Joined: Tue Apr 01, 2014 3:29 pm

Re: Scripting Threshold - VisTargetTrigger

PostPosted by kurthollowell » Sun Apr 27, 2014 9:57 am

Never mind I was able to get it working. Thanks for your help :) I just made my own little script:

void Start () {
sliderBar = SliderButton.GetComponent<SliderBar>();
}

// Update is called once per frame
void Update () {
this.GetComponent<VisBaseTrigger>().triggerThreshold = sliderBar.value;
}
kurthollowell
 
Posts: 3
Joined: Tue Apr 01, 2014 3:29 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