Hi people, I am new to FMOD and especially C#/Unity.
I am trying everything I can here but I can’t change the parameter by a script (I know FMOD comes with one but I trying to build my own).
But my setParameterByName and getParameterByName are not connecting to the event. The set event is not setting anything, and getting is just getting 0, don’t matter the value I input the start in FMOD.
Here is my code if anyone can help me I am at least 4 - 5 hours in it and have no clue
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ChangeMaterialFS : MonoBehaviour
{
public float val;
FMOD.Studio.EventInstance StepFoot; // Stepfoot is a variable that the type is a fmod somthing
void Start()
{
StepFoot = FMODUnity.RuntimeManager.CreateInstance("event:/Footstep"); // Stepfoot is a specific event in FMOD
}
private float debuguing = -1;
private void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Player"))
{
print("setting to "+val);
StepFoot.setParameterByName("Material", val, true); // Set Material to val
StepFoot.getParameterByName("Material", out debuguing); // Set Material to val
print("getting :"+debuguing);
}
}
}