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 HappyCrayfish · Apr 21, 2015 at 05:15 AM · javascripttextureunity5effect

Applying texture on a texture…? Click for more info

So, what i want to learn is how to apply a texture on a object, over a already applied texture. Kinda like a spray. A wall doesn't change "texture" if you would spray paint on it in real life, it would be a 2nd layer over the "texture". So, what i want to do is, example a gunshot. If i shoot at a wall, there should be a bullet-hole, right? So, how do i add the actual bullet-hole to the wall? And how can i make the gun-shot "sprays/textures" look different depending on what "surface/material" it gets "shot" at? Example, if i shoot at a wall, there will be a gun-shot, made out of the material that the wall is. But if i shoot at a window i don't want the gun-hole to look like a bullet-hole i a wall, i want it to look like a bullet-hole in glass. So, how do i do this? (Please, tell me if you don't understand, English is not my primary language and I'm having a hard time explaining. But just tell me and i'll try again.)

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
1
Best Answer

Answer by DwaynePritchett · Apr 21, 2015 at 05:31 AM

I would almost create prefabs of the various "bullet hole" types you want. Then, make a script called Surfaces or something similar. Set a variable in there called "Surface Type". Attach this script to your various objects. When the object gets shot, check to see if it has a component of type "Surfaces" if it does, take the Surface Type from it, and spawn the appropriate prefab for it. Have the prefab designed to fade out overtime and delete itself. This is totally theoretical, and off the top of my head. But, I hope it helps.

-Dwayne Pritchett

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 Slider_j · Apr 21, 2015 at 05:38 AM 0
Share

i was thinking along the same lines but ins$$anonymous$$d of putting a script on every surface, i would run a script on the player fireing that gets the surface that is hit and does a

 getcomponent<$$anonymous$$eshRenderer>().material

and then use that to define what prefab bullet hole you would place.

avatar image DwaynePritchett · Apr 21, 2015 at 05:48 AM 0
Share

I think that is a pretty solid option. Remember to add a default case, for when you don't have a unique material/bullet hole relationship for a specific surface.

-Dwayne Pritchett

(If that solved your problem... please check as answered.)

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

BCE0048: Type 'UnityEngine.Component' does not support slicing. 1 Answer

Weird intermittent pink editor bug 0 Answers

How to display textures that are in an array? 1 Answer

Fade mesh material color to texture 1 Answer

How to make an infinite scrolling background that changes theme? similar to to the game JetPack JoyRide on mobile 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