Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 internationalfish · Apr 11, 2018 at 03:21 AM · webgltilemapscriptableobject

Dynamically created Tilemap tiles render in editor and Android build but not in WebGL build

My last two projects have been using Tilemaps with small sprites to dynamically create tiles. The previous one I didn't finish (7DRL), so I didn't get around to addressing deployment, but now I'm getting there and am trying to solve this issue.

I build a test project to get a minimal reproducible script, and this does it:

 using UnityEngine;
 using UnityEngine.Tilemaps;

 public class TileTest : MonoBehaviour {
     public Tilemap tilemap;
     public Sprite floorSprite;

     void Start () {
         Tile tile = new Tile();

         tile.sprite = floorSprite;
         tilemap.SetTile(new Vector3Int(1, 1, 0), tile);

         tile = ScriptableObject.CreateInstance<Tile>();
         tile.sprite = floorSprite;
         tilemap.SetTile(new Vector3Int(-1, -1, 0), tile);
     }
 }

The sprite is just a small PNG, and the tilemap is a Tilemap object inside of a Grid (normal). This script is attached to the grid. That's exactly all there is to this project.

In the editor and in Android builds, both of the instantiations work. The first generates a warning, which is expected; I just wanted to try directly to see if the behavior varied, which it doesn't.

I can't find anything in Build Settings or PlayerSettings that seems like it should impact this. The sprite is referenced on the script on the grid, and just to make sure, I put the Sprites folder in a Resources folder; no change. Firefox and Chrome/Chromium (I've tested this in Windows 10 and Debian 9) both just display a blank canvas, which is the right color for the build (and in the more complex projects it also displays my non-tile sprites and animations), but no tile sprites render.

In the actual project, I'm dynamically instantiating prefabs with animations that work fine across all platforms. Why would it be failing in WebGL?

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by internationalfish · Apr 11, 2018 at 03:55 AM

Turns out this is a known bug in Unity that's been waiting for a fix for a while now... it's supposedly been fixed "in a future release," though the current beta still chokes on it.

Comment
Add comment · Share
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

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

81 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

Related Questions

How can I modify the sprite of a particular Scriptable Tile in a Tilemap? 2 Answers

Scriptable tile 1 Answer

Can I generate a Tile Palette made up of custom/scriptable Tiles as opposed to default Tiles? 0 Answers

WebGL distorts tilemap 0 Answers

Need tiles to contain data or a reference 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