Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by roegel · Jan 25, 2021 at 05:35 PM · renderingcolorandroid build

gameobjects are pink in apk built on linux

Hello,

I am using Unity 2020.2 on linux and I try to export an APK but all my GameObjects are pink in the APK. In the editor, everything is fine. I have reduced my problem to the simple example below, with a sphere and no colour. I am associating this script to the main camera. The sphere is gray in the editor and pink in the APK.

If instead I add a sphere in the scene through the editor, still with no materials, and build the APK, then the sphere is correctly rendered in the APK.

I have tried this on two recent Android phones and an older Samsung tablet, and the results are identical.

I see only two solutions:

1) either something is missing in my script (but it can't be the colors, since it works without colors when I add the sphere through the interface with no materials);

2) or there is some problem with the linux version of Unity; I can't test Unity on Windows at the moment.

Can someone else confirm this behaviour on linux?

Thanks

 using UnityEngine;
 public class Example : MonoBehaviour
 {
   void Start()
     {
         GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
     }
   void Update()
     {
     }
 }
 
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image roegel · Jan 24, 2021 at 01:03 PM 0
Share

I believe that the problem is linked with the default material setting. When an object is created in the editor, it gets some default material and shader, and this default should be reproduced in the script. I have tried to add a new $$anonymous$$aterial within the script, with the standard shader, and linked it to the sphere, but it doesn't help. The sphere is still pink (in the APK only) when it is entirely scripted, and fine (APK and editor) when it is first created through the editor.

avatar image roegel · Jan 24, 2021 at 01:37 PM 0
Share

I have finally solved the problem, at least for the moment. I have created several material assets which I have put in the Resources folder. Then, I loaded the material with mat1 = ($$anonymous$$aterial)Resources.Load("$$anonymous$$at1"); and assigned them to the objects. It works in the APK! But still, I assume that there is a way to create the materials without going through Assets.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

130 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Objects Not Rendering On Android 1 Answer

How do I have multiple cameras that have a black and white view in one while the other shows a color at a certain time on a certain object? 0 Answers

Create a mesh and color cubes 2 Answers

Material doesn't have a color property '_Color' 2 Answers

rgb value detail 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges