• 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 monty · Apr 21, 2011 at 06:52 PM · decal

problems with decals

Decal.dCount++;
var d : decal = gameObject.GetComponent("decal");
d.affectedObjects = new GameObject[1];
d.affectedObjects[0] = go;
d.decalMode = DecalMode.MESH_COLLIDER;
d.pushDistance = 0.009 + BulletMarkManager.Add(gameObject);
var m : Material = new Material(d.decalMaterial);
m.mainTexture = useTexture;
d.decalMaterial = m;
d.CalculateDecal();

i am having trouble with this script cos unity says decal (first time in second line) does not denote a valid type. i have the editor file in unity containing the decal editor and some other scripts but it doesn't go away could someone please help with this problem cos i need it done soon. thanx for any help u give

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

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Marnix · Apr 21, 2011 at 07:20 PM

Decal is with a capital D.

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
avatar image
0

Answer by equalsequals · Apr 21, 2011 at 07:22 PM

In the line: var d : decal = gameObject.GetComponent("decal");

Where you are putting "decal" you need to insure that is the component's type. Chances are it is "Decal".

Since everything is case sensitive, it says that there is no class of type "decal" because there isn't, it is "Decal".

Try:

var d : Decal = gameObject.GetComponent("Decal");

Cheers

==

Comment
Add comment · Show 5 · 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 monty · Apr 21, 2011 at 07:44 PM 0
Share

that does not work i think it is cos there is no decal script because when this error has appeared before for other things i just had to import the script with that name but i dont have this script and another answer for this same topic said i needed that editor folder but that hasnt worked either. thanx for helping though and does anyone have any other ideas about the problem.

avatar image equalsequals · Apr 23, 2011 at 03:49 PM 0
Share

Well you need that script in order to access it...

avatar image chrismisballs · Apr 27, 2011 at 10:35 PM 0
Share

I have the same problem there is a script missing i just dont know which one. Im going through my files trying to figure it out, Does it matter where the scripts are placed in the project folder?

avatar image equalsequals · Apr 28, 2011 at 01:21 PM 0
Share

Sometimes it does. Scripts which use UnityEditor and extend Unity Editor classes need to be in Assets/Editor. Also, sometimes, depending on when things need to be compiled, run-time scripts can be placed in Assets/Plugins

avatar image loihb · Nov 12, 2011 at 01:16 PM 0
Share

I find problem why it doesn't work it's working only if decal scripts in Standard Assets folder. (assets/Standard Assets)

avatar image
0

Answer by chrismisballs · Apr 27, 2011 at 11:31 PM

I figured it out the

-In standered assets folder

go to the folder that says "Decal System" and make sure you have the scripts

-"Decal"
-"DecalMode"
-"DecalPolygon"

Also make sure none of the script is edited out with "/*"

This should solve the problem it did for me good luck.

(anything else comment back)

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
avatar image
0

Answer by loihb · Nov 12, 2011 at 02:37 PM

I find problem why it doesn't work it's working only if decal scripts in Standard Assets folder. (assets/Standard Assets)

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

Can anyone explain the decal scripts of the BootCamp Demo? 1 Answer

Bullet Marks On Moving Object : 2D 1 Answer

How do you set the UVs for a decal texture? 0 Answers

Instantiating blood on walls using gameobject 1 Answer

Decal like 2d texture onto cylinder placing without repeating 1 Answer


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