Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 Zeugl · Jul 17, 2015 at 04:01 AM · objectrendererinvisiblehidegradually

Is there another way to hide an object

Before I describe my problem let me say that I have a solution but it's not exactly what I am trying to achieve.So,I'm building an isometric game and I need to hide a couple of walls that stop me from seeing my character.I don't know how to do it for only one object at a time ,since they share the same material,in a gradual way.I can hide them by linecasting from the camera to the player every third of a second and disabling the mesh renderer,and it works but it's not very nice looking since the walls just pop out and then in back into existence.So if anyone knows a better way to do it,like hiding gradually,only the object that interfere's with my line of sight,or can point me in the right direction I would very much appreciate it.Thanks

Comment
Add comment · Show 3
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 meat5000 ♦ · Jul 17, 2015 at 10:04 AM 0
Share

You could use a shader.

avatar image Zeugl · Jul 17, 2015 at 02:24 PM 0
Share

a shader affect's every object sharing the material

avatar image meat5000 ♦ · Jul 18, 2015 at 05:54 AM 0
Share

Everything in the game uses the same material?!?

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by SmileQ · Jul 17, 2015 at 10:04 AM

How about having 2 materials?

  1. the normal one that you are using for your walls,

  2. a material that is the same as the first one, but would get used when you are trying to fade out.

Then when you want to make a part of the wall disapear, asign the second material to it and fade it out.

Would go like this when you wanted to fade out a wall.

  • Asign 2. material to this part of the wall

  • Fade out the 2. material

and when your fading back in, when the alpha reaches max(normal), reasign the first material, so they dont fade out when your fading a new piece of the wall.

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 Zeugl · Jul 17, 2015 at 02:23 PM 0
Share

that would be a hit for the performance,I'm trying to make this work on mobile and an extra material for each object I need to hide wouldn't be very good,I might as well just add a material per object,but again that's not good for performance.Anyway as I was saying I have a solution it's just not exactly what I want but if no one has any ideas I'll use what I have

avatar image SmileQ · Jul 18, 2015 at 05:48 AM 1
Share

Shouldn't be a big hit.

Just use 2 materials in total, not a new one for each object.

Dont create the new material each time you have to fade a part, use the same material.

have a public material that you set in the editor.

avatar image Zeugl · Jul 18, 2015 at 05:52 PM 0
Share

that's a good idea,thanks I'll give it a shot

avatar image Zeugl · Jul 18, 2015 at 06:59 PM 0
Share

just came back to confirm that it works,thanks again

avatar image SmileQ · Jul 19, 2015 at 07:11 AM 0
Share

Glad to help

avatar image
0

Answer by FirePlantGames · Jul 17, 2015 at 04:43 AM

Have you ever considered lowering the walls opacity?

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 Zeugl · Jul 17, 2015 at 07:00 AM 0
Share

That would affect all objects sharing the same material,so it doesn't work for me

avatar image FirePlantGames · Jul 17, 2015 at 05:58 PM 0
Share

Just write a shader.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Renderer on object disabled after level reload 1 Answer

Invisible effect? 3 Answers

Change Mesh Renderer size property? 2 Answers

Having an Invisible Object that Casts Realtime Shadows. 4 Answers

Disable and hide object after collision between player and cube 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