0
0

I’m getting ERR_INVALID_PARAM when trying to get properties and I couldn’t find a reason.
Does anyone see a problem with that code?

[code:1pdg1tve]
FMOD.Event eventInstance = new FMOD.Event();
GUID id= SomeValidId;

    Errcheck(EventSystem.getEventByGUID(ref id, EVENT_MODE.INFOONLY,ref eventInstance));//tried both InfoOnly and Default.

    IntPtr propertyValuePtr = new IntPtr();
    Errcheck(eventInstance.getPropertyByIndex((int)EVENTPROPERTY._3D_MINDISTANCE, propertyValuePtr, false));//tried both true and false. The event is 3D.

    float* valuePtr = (float*) propertyValuePtr.ToPointer();
    float value = *valuePtr;

[/code:1pdg1tve]

  • You must to post comments
0
0

Just solved that while trying to reproduce the problem in C++.
It does not provide you with a pointer to the value but writes the value to a pointer you provide.

Here is the correct way:
[code:34l6vtw6]
FMOD.Event eventInstance = new FMOD.Event();
GUID id= SomeValidId;

    Errcheck(EventSystem.getEventByGUID(ref id, EVENT_MODE.INFOONLY,ref eventInstance));

    float value = 0;
    IntPtr propertyValuePtr = new IntPtr(&value );
    Errcheck(eventInstance.getPropertyByIndex((int)EVENTPROPERTY._3D_MINDISTANCE, propertyValuePtr, false));

[/code:34l6vtw6]

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.