Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
oh_cripes's avatar
oh_cripes
Honored Guest
2 years ago

WWise Crash Help

I've been integrating Wwise into our game and it seems to run ok on PC and in the editor but crashes on Quest. This seems to happen just after loading the level and started happening after adding some code to trigger events when physics objects collide. The code is basically:

 

public class CollisionSfx : MonoBehaviour
{
    public AK.Wwise.Event ImpactEvent;
    public AK.Wwise.Switch MaterialType;
    public AK.Wwise.RTPC ImpactMass, ImpactVelocity;
    private Rigidbody body;

    void Awake() {
        body = GetComponent<Rigidbody>();
    }

    void OnCollisionEnter(Collision collision)
    {
        MaterialType.SetValue(gameObject);
        ImpactMass.SetValue(gameObject, body.mass);
        ImpactVelocity.SetValue(gameObject, collision.relativeVelocity.magnitude);
        ImpactEvent.Post(gameObject);
    }
}

 

Any one out there got any ideas?

No RepliesBe the first to reply