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 PaulPanzer · Apr 01, 2011 at 09:46 AM · shaderterrainmaintex

Material doesn't have a texture property '_MainTex'

Hey,

I'm new to unity3d.

When I'm creating a terrain, I always get this error "Material doesn't have a texture property '_MainTex'"

How Can I fix this problem, I alread created a "Shader", but do I have to link the terrain to the shader or what???

Thanks

Edit: whithout the terrain I do not get any errors....

Comment
Add comment · Show 1
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 stevethorne · Apr 08, 2013 at 04:06 AM 0
Share

This tends to happen when code is copy pasted into the Unity shader file. It hates when you copy paste things. So just make sure you type everything yourself. It can be a bit of a pain when you're trying to follow a tutorial, but that's what happens. I imagine that some of you are having luck when you restart Unity because it may fix some line endings when it reimports assets.

It may also be because you aren't defining your properties in the "Properties" section.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Bunny83 · Apr 01, 2011 at 11:43 AM

Search first for an existing question.
http://answers.unity3d.com/questions/45130/material-doesnt-have-a-texture-property-maintex

It seems your shader don't have a _MainTex property.
Btw. what kind of terrain do you use? The Unity-built-in terrain system needs some very special shaders.

Comment
Add comment · Show 2 · 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
avatar image PaulPanzer · Apr 01, 2011 at 03:30 PM 0
Share

I'm using the "Unity-built-in terrain system" and I found this link before, $$anonymous$$y shader contains an "_$$anonymous$$ainTex".

Is there a tutorial for terrains???

Thanks

avatar image PaulPanzer · Apr 01, 2011 at 07:08 PM 0
Share

Problem is/was that I am using android^^

avatar image
0

Answer by Mike 3 · Apr 01, 2011 at 07:09 PM

From a chat in IRC, it seems to happen when you try to use Android or iOS as a build target.

Terrains aren't supported on either, so throws out the error.

I'm going to bug report that as a fairly unhelpful error though.

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

1 Person is following this question.

avatar image

Related Questions

change terrain built in shaders 1 Answer

Can't use material with shaders which need tangent geometry on terrain. 1 Answer

Noob Question - Custom trees and aliasing 1 Answer

Improved Graphics for Terrain 1 Answer

Black Trees 2 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