Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't put material on terrain. #81

Closed
mihakrajnc opened this issue May 23, 2017 · 2 comments
Closed

Can't put material on terrain. #81

mihakrajnc opened this issue May 23, 2017 · 2 comments

Comments

@mihakrajnc
Copy link

I'm trying to put a custom material on my terrain, but it's not working.

My visualization only has a TerrainFactory and a MeshFactory on it. If I use a custom material under TerrainFactory -> Material, the material doesn't get applied to the terrain mesh.

Looking at the generated mesh, the material that gets applied is the "Default-Material".

@mihakrajnc
Copy link
Author

Seems like this might be already fixed in the current repo.

A quick and dirty temporary fix is just to replace

if (tile.MeshRenderer.material == null)

with

if (tile.MeshRenderer.material == null || tile.MeshRenderer.material.name == "Default-Material (Instance)")

inside of TerrainFactory.cs.

@david-rhodes
Copy link

@mihakrajnc you are correct, that material injection never worked properly. However, this should be fixed in develop (I noticed this during a major refactor). Thanks for the temporary solution for those that have not yet upgraded!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants