So I just ran into a weird problem. I’m working with Thomas on the dice roller. We have a splash screen that loads up before anything else, and while the splash screen is displayed, there is no GUI. I implemented this via a variable called OnSplashScreen that gets set to false once the user clicks on something.
This value gets checked in two places:
Update checks for it and a mouse click, and if the user clicks on the mouse, it changes the background and adds three dice as an example.
OnGUI verifies if we are showing the splash screen. If so, no GUI elements are displayed.
// First thing we do is show the splash screen
private bool OnSplashScreen = true;
void Update()
{
if (OnSplashScreen Input.GetMouseButtonDown(0))
{
OnSplashScreen = false;
// For some reason this line crashes it on my machine
AddDice(3, 6); // Add 3d6
RandomizeBackground();
}
}
void OnGUI () {
if (OnSplashScreen)
{
return;
}
// [...]
// Build GUI
}
Here’s the problem:
The initial call to AddDice makes the application crash on two different Core 2 Duo from the standalone application.
It works in my Core 2 Duo fine if running from within the Unity environment.
On a second Core 2 Duo that neither has Unity nor has run the application before, the standalone crashes.
Both standalone and environment run perfectly from Thomas’ G5.
Things we have tried:
Building on Thomas’ installation, running on mine (just in case my Unity was borked).
Changing the standalone quality to Good, to match the editor quality.
Changing the editor quality to Fantastic, to match the standalone player quality.
Removing the application preferences file on my machine.
Removing the unity preferences file, rebuilding.
Cleaning the /tmp directory (just in case).
The behavior is the same.
The AddDice call of course works as expected in other areas of the application (or, like I said, on other machines).
Does anyone have suggestion or has seen similar behavior?
PS: Web player version works just fine, even on Fantastic quality. It’s just the standalone in both Core2Duos I’ve tested it on.
public Transform[] diceModels;
// [...]
for(int i = 0; i < count; i++)
{
Transform die = (Transform)Instantiate(dieModel, transform.position, Quaternion.identity);
die.parent = transform;
die.gameObject.name = "D"+faces;
SpawnDie(die);
}
Thinking it might be that we’re supposed to work over GameObjects I changed the array and all references, but it still crashes on the two Intel machines we have tried. Like I said, that code works, just not when I call if from the “if (OnSplashScreen)” from the previous post.
could you put your whole scripts here.
potentially you mess something in the communication or setup that causes that.
there theoretically shouldn’t be a difference but a G5 is just significantly slower than a G5 so you perhaps get the problem due to the higher speed and some assumption of you / side effects or at worst because you missuse threads to do work which run in parallel on a c2d, unlike a G5 where they run each after the other.
Slower speed on the G5 is likely not the reason why it works - I just got someone to try them on a more recent iMac Core 2 Duo, faster than either of these, and it works well. From the beginning of the crash report:
It might be something specific to the video card family, since the ones where it crashes have Radeon X1600s while the iMac my friend tested on has an HD 2600.
I’ve filed a player bug report, with the sample app and the crash report.
Thanks for the pointers. I’ve double checked, and we’re only using the standard shaders. Moreover, creating the objects later in the app does work - it’s only if I instantiate them right then that it fails. Both machines with the Radeons are using OSX 10.5.5.
I’m sure this discussion will prove helpful for the Unity folks if it is indeed a bug.
I have a build that is working on some macs, and crashing at start up on others as well. My crash log looks the same as the one in this thread. Mine is working well on an intel imac, crashing on 2 newer mac pro’s, and crashing on a G5.
Here is the crash log from mine:
I don’t know how to interpret this at all though, but am noticing that the ??? on line 12 on mine, has something about the graphics card on the one earlier in the thread. I’ll start checking what graphics setting I may have enabled…