- Home /
HELP!!! My built game crashes when a trigger is hit
I have a giant gate in my scene, with a collider quad which gets destroyed when you activate a button(gameobject).
On the quad, there is an audio source, which when hit by a game object, makes a sound. The sound plays when in the editor view and there are no scripting errors
But when I build my game, as soon as something hits it(rigidbody), the game crashes.
Everything works(Destroying the quad on activation, player collision with the quad), only when hit by a rigidbody does the game crash.
Any ideas on what to do. Like I said, it DOES work in the editor, only when built it crashes :/
I HAVE TRIED:
Development build on/off
x86 build
x86_64 build
DX9 & DX11
Script debugging
Nothing seems to fix it and it's probably the most obvious fix
Answer by GoThXoRd¹ · Jan 29, 2014 at 09:42 AM
The sound is what was crashing it.
BUT WHY?! It's a simple
var collisionSound : AudioClip;
function OnCollisionEnter(other : Collision){
audio.PlayOneShot(collisionSound);
}
Okay. I'm not entirely sure why it was doing this, but
I removed (other : Collision) and it seems to fix everything. Is still confusing me, but it works now, I won't complain.