Hello!
I recently upgraded to the new patch version of Unity, 4.6.1p2 to fix the crashes on Android 5 devices. The game runs exactly how I want it inside the editor + unity remote. However, when I run the game on my android devices (Nexus 4, Galaxy Tab 3 7.0), many scripts do not work the same!
I’m wondering if anyone else has seen this issue… the only change was to include the patch. Previously on 4.6.1, it works great on my Galaxy Tab (android 4.1.2), but crashes on my Nexus 4 (android 5.0.1). Now, the game works on both devices, but the scripts are totally out of whack >.>
It’s rather late and I need to turn in, but I’ll see if I can post some videos of this in action tomorrow.
Cheers!
i have the similar problem…but i crashed
Hey Sansidiok! Thanks for the suggestion. I figured out what’s causing the problem on my end. It is one of the shaders I cobbled together. Somehow, with 4.6.1p2 this shader works fine on the editor, but not in the device. I’ll be uploading a sample project shortish.
Ok, so here’s a sample project demonstrating the problem I encountered. It might be my fault cobbling a shader, but it works on Unity 4.6.1 and works in the editor…
If you would extract this zip file and load it in the editor, you should see 3 spheres approaching the camera. Two of them have child objects that are assigned a solid color shader, while the last uses a built in shader
However, if I Build and Run this project on my Galaxy Tab 3 7.0 (SM-T210R), Android version 4.1.2, the first two spheres (parent objects) move as expected towards camera.
The child objects however, hover at (probably) z=0. And what’s fun, is on my device, when the sphere parent objects move past z=0. the child object snaps onto the parent object and follows along! >.<
The 3rd object, using the regular shader, is fine.
So this points to my shader being wrong, but it works find in the editor, and earlier builds!
1911310–123290–androidBugTesting.zip (217 KB)
This is the code I cobbled together from the unity code sources: It’s a very basic solid color shader that has a sin function modulating the color.
Shader "GWCustom/glowPulseCG" {
Properties {
_GlowColor ("Glow Color", Color) = (0,1,0,1)
_GlowSpeed ("Glow Speed", Range(0.1,50)) = 5
}
SubShader { // Unity chooses the subshader that fits the GPU best
Pass { // some shaders require multiple passes
CGPROGRAM // here begins the part in Unity's Cg
#pragma vertex vert
#pragma fragment frag
uniform float4 _GlowColor;
uniform half _GlowSpeed;
float4 vert(float4 vertexPos : POSITION) : SV_POSITION
// vertex shader
{
return mul(UNITY_MATRIX_MVP, vertexPos);
}
float4 frag(void) : COLOR // fragment shader
{
half multiplier = 0.7 + (sin(_Time.y * _GlowSpeed)*0.3) ;
return _GlowColor * multiplier ;
}
ENDCG // here ends the part in Cg
}
}
}
Has been reported as
Case 661422
in case it’s a real bug and not just my stupidity.