- Home /
Using the "Fade"-Class crashes unity-iphone build...
Hi,
at first, thanks to Eric5h5 for sharing his "fade"-class in the unifycommunity. I would like to using it for my unity-iphone project and there i want to fade between to color-values.
I created a new "Standart Assets"-Folder and paste that script in a "Scripts"-folder and then added the fade-script to an gameobject.
Then i added the following code:
newColor = colors[counter]; // counter iterates through an color-array
StartCoroutine(Fade.use.Colors(mat.renderer.sharedMaterial, currentColor, newColor, 1f, EaseType.InOut));
currentColor = mat.renderer.sharedMaterial.color;
If i start using my project with my iphone and the unity remote-app, it works great. Then i built & run the project to watch it on my iphone. Then the build dont run and i get the following xcode-console output:
-> applicationDidFinishLaunching() Failed to load AOT module 'e7d9245eb401c4ad6ace44fe57e1933c' while running in aot-only mode because a dependency cannot be found or it is out of date.
Debugger stopped. Program exited with status value:1. Unity-iPhone exited with status 1
The error only appears if i use the code below, if i uncomment it and use my "old" code, it works without fading.
mat.renderer.sharedMaterial.color = colors[counter];
So it would be great to know if someone could help me, please. Thanks for your time. yosh
Answer by Eric5h5 · Feb 26, 2010 at 05:18 PM
There seems to be a bug where calling the Fade script (which is in Javascript) from C# fails on the device for some reason, though it works in the editor and in builds made from regular, non-iPhone Unity.
You can either use Javascript when calling Fade functions, or rewrite the Fade script in C#.
If you successfully rewrite it, you should post it on the Wiki so other users can use it, as well. $$anonymous$$ake sure your code is clean. :)
Your answer
![](https://koobas.hobune.stream/wayback/20220612085116im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to achieve best fps for Animating - Built-in Unity animation or coded through Javascript? 1 Answer
AnimationEvent not reliably triggerd on iPhone 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Unity Invoke method delay factor vary device to device 1 Answer
Animation not playing when returning to a previous loaded scene 2 Answers