Hi Everybody. I have a issue, i try to play a dynamic music, with triggerIn and triggerOut.
I start the game with a music, and i walk for the scene, i triggerEnter and change the parameter to sound other part of the music, i go out, and triggerExit change the parameter to other part of the music. The thing is that, if i arrive to a place where i can arrive for two differents ways, when triggerEnter in that place i should choose one or other parameter value, in function from i have arrived.
OK!!, How can i say to script, that if triggerEnter (player) and parametervalue is XX.Xf change to XY.Xf or if i triggerEnter (player) and parametervalues is otherXX.Xf (because i come from other side) change to YY:Yf parametervalue…???
i try this:
using UnityEngine;
using System.Collections;
public class McaIrish : MonoBehaviour {
MusicPipes MusicaC;
// Use this for initialization
void Start () {
MusicaC = GameObject.Find ("Camera_low").GetComponent<MusicPipes> ();
//MusicaC.Mca2.setParameterValue ("Strings", 0f);
}
void OnTriggerEnter (Collider hit){
if (hit.GetComponent<Collider> ().CompareTag ("Player") && (MusicaC.M_Pipes.setParameterValue ("MUSIC", 2.46f)))
{
MusicaC.M_Pipes.setParameterValue ("MUSIC", 2.31f);
}
else if (hit.GetComponent<Collider> ().CompareTag ("Player") && (MusicaC.M_Pipes.setParameterValue ("MUSIC", 0f)))
{
MusicaC.M_Pipes.setParameterValue ("MUSIC", 0.56f);
}
}
}
if i make this, Unity say me this: “…Assets/McaIrish.cs(23,51): error CS0019: Operator &&' cannot be applied to operands of type
bool’ and `FMOD.RESULT’…”
thanks for your help