|
Hello, I have a turret that has a muzzle flash that is on for one frame. In the editor, you can clearly see that the muzzle flash when it fires, whereas in the build, you only see it sometimes. I'm not sure if its to do with the LateUpdate? or FrameCounting? I'm not really familiar with all that. Below is the code that controls the muzzle flash:
Any reason why its doing that? I would appreciate any help. Thanks folks.
(comments are locked)
|
|
You should probably make the flash last for a specified period of time (1/20th of a second or something), rather than one frame. The game runs faster in a build than the editor, and if you're getting, say, 150 fps and your screen refresh is 60Hz, then it's somewhat likely a single-frame flash wouldn't even be drawn by the monitor. it seems that you are right eric
May 02 '11 at 02:28 AM
Ashkan_gc
how would one do that?
May 03 '11 at 11:32 PM
oliver-jones
Any number of ways, yield WaitForSeconds probably being the simplest.
May 03 '11 at 11:45 PM
Eric5h5
(comments are locked)
|
|
Do not use editor classes like Debug. They are only for using in the Unity editor and are not available at runtime. Does that have anything to do with my problem?
Apr 25 '11 at 02:39 PM
oliver-jones
As far as I know Debug is an Engine class so this should not be the problem.
Apr 28 '11 at 09:35 AM
Clem
@tomekkie: That's not actually correct; Debug.Log works fine in a build, and Debug.isDebugBuild is intended to be used in a build (it just returns true in the editor). DrawLine/DrawRay don't though.
Apr 28 '11 at 12:13 PM
Eric5h5
if you check the debug build checkbox when building then isdebug will return true in your build too.
May 02 '11 at 02:26 AM
Ashkan_gc
(comments are locked)
|

Can you hear the audio being played in the build? When do you set m_LastFrameShot?
Updated script. And Yeah - I can still hear my audio.