• 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 /
This question was closed Aug 21, 2016 at 05:55 PM by lumpigerAffe for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by lumpigerAffe · Aug 20, 2016 at 02:14 PM · playertexturescar

How to print textures on objects in runtime?

I am searc$$anonymous$$ng for an more or less easy way to print textures on objects in realtime. For example I want players to leave footprints, so I want a normalmap printed at the footposition. Or I want cars to leave tracks. What are methods to do such effects in Unity?

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

2 Replies

  • Sort: 
avatar image
1
Best Answer

Answer by toddisarockstar · Aug 20, 2016 at 11:17 PM

you can change a texture of an object like t$$anonymous$$s:

         public Texture2D tex;
                     tex=new Texture2D(2,2);
 
 
  // if you really really want to draw on an actuall texture you can set the color of pixels like t$$anonymous$$s:
 
            tex.SetPixel(1, 1, Color.green);
            texture.Apply();
 
           someobjectt$$anonymous$$nggy.transform.renderer.material.mainTexture=tex;
 

but if you wanted footprints you wouldn't change a texture, you would create a separate footprint object and simply spawn it on top of the terrain. You would use a simple plane object with a transparent shader.

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 lumpigerAffe · Aug 21, 2016 at 11:15 AM

Thanks. I was looking for the second way to do it. Can I only have an normal map applied with t$$anonymous$$s transparent shader or do I need to give the footprint also a diffuse tex?

Comment
Add comment · Show 1 · 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 toddisarockstar · Aug 21, 2016 at 03:17 PM 1
Share

Any transparent shader should work seems "transparent/diffuse" is the most basic. Either "texture" or "normal map" will work with your import settings .

Of course, you need a paint program that handles PNG images and can draw "clear". PNG image files save alpha info for translucency.

If you don't have one already here is a good free one http://www.getpaint.net/index.html

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Vehicle exit rotation bug / random vehicle explosions bug. 0 Answers

change script so enemy car gets destroyed when collided with player car 0 Answers

player to kill ai 0 Answers

Get in and Out of a car. 2 Answers

script help gameobject to playercar 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