Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Danor · Jan 02, 2016 at 01:26 PM · 2d2d gameunity52d-gameplay

Make objects invisable when they are passing through

Hi! I'm working on an open world continuation of my previous game Roundabout, you should look at the trailer to get a better idea of what i'll be talking about: https://play.google.com/store/apps/details?id=com.DaneGillis.RoundaboutFree

All enemies are made out of the same "special" material like the walls which in the game would allow them to pass through them, fuse with them but then "re-emerge" and continue moving or another use would be to have them enter the wall, becoming invisable transitionally and then destroy them when they have "dissapeared" completely, making it seem like they merged with the wall.

To achieve this effect i'd need something like a mask but the other way around, instead of hiding objects that aren't in a certain area, i'd need to hide objects or parts of it when they enter an area and have them become visable again while leaving.

The problem is that i don't know where to begin making something like this and it's a pretty specific thing so i can't find it on google, i'm hoping to get some tips on how to hide the objects in this way.

Thanks in advance.

Comment
Add comment · Show 4
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 ShadyProductions · Jan 02, 2016 at 01:39 PM 0
Share

http://docs.unity3d.com/ScriptReference/Collider.OnTriggerEnter.html http://docs.unity3d.com/ScriptReference/Collider.OnTriggerExit.html

these 2 might help you?

avatar image Danor · Jan 02, 2016 at 02:18 PM 0
Share

@ShadyProductions yeah you're right but i'm looking more for tips regarding how to hide the objects, i'll update my question thanks

avatar image ShadyProductions Danor · Jan 02, 2016 at 02:22 PM 0
Share

disable them for sometime? gameObject.SetActive(false); ? I don't quite understand what you mean with hide them..

avatar image Danor · Jan 03, 2016 at 07:36 PM 0
Share

what you described would definitely hide the objects, the player wouldn't see them when they enter the wall but this way the entire object would turn invisable OnTriggerEnter but it wouldn't happen transitionally, i need it to slowly become invisable, if half of the object is in the wall then only that half should be invisable and the other half is still visable while it's still entering the wall. i want to create a merging effect, as if the enemy object and the wall fuse into one and then later the enemy object would leave the wall again, with only the parts that have exited turning visable while the rest is still invisable. I'm probably not explaining it very well and i do apologize for that, english isn't my first language but take a look at what mask does, when an object is half into the mask area, only the part inside the mask area is shown and the rest is invisable, well this is what i want to do but the other way around, only the parts outside of the area should be shown, this way i would be able to place "cloak" areas on the map.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by ConsoleHack000 · Jan 03, 2016 at 09:03 AM

You can do this by disabling the Mesh Renderer when you are inside a wall (OnTriggerEnter) , and then re-enabling it when you are outside the wall (OnTriggerExit I believe)

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 Danor · Jan 03, 2016 at 07:28 PM 0
Share

that would be an easier solution and i may be able to use that too but i don't think this would allow me to transitionally hide the objects, they would turn invisable instantly which wouldn't create the "merging" effect that i'm looking for, thanks for your answer though!

avatar image
0

Answer by dilippatil · Jan 03, 2016 at 08:24 PM

You can try fadeout/ fadein transition by playing with that objects materials alpha value in color attribute by selecting appropriate shader(which will support transparency). If u want particular part of that object should be visible/invisible, I am sure you can achieve it through shaders alpha value/transperience attribute. As well as u can witre your woun shader to do translation . I hope this will guide you to what you are looking for.

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

54 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

moving player top down,movement in unity 2d 0 Answers

How to make a sprite respond to a specific color? 0 Answers

Stuttering in simple 2D game using interpolation? 1 Answer

When 2D Car Turns Upside Down, Game Over Scene Should appear. 1 Answer

Why Is there A slight jitteryness on player movement and camera? 0 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