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
1
Question by armoredpokey · Mar 25, 2012 at 10:27 PM · cameracollidercirclevisual-effects

smoothly transmogrify an object as it enters a circle

I've asked a few questions about isolated aspects of this problem, but it's gotten to the point where I ought to just explain the whole thing and see if there are any solutions. Thanks in advance!

I have a brilliant circle of light that moves across the screen with a character. Inside this circle, the world is different -- certain objects appear, others disappear, others experience a change in appearance.

It's straightforward to make objects appear, disappear, or change when they are fully within the light's radius. The tricky thing is when they're only partially within the circle. We want effects like these:

Object disappears within circle:

Object appears within circle:

Object changes within circle:

We're making a 2D game, and we've thought of various depth tricks to accomplish some of these effects, but we'd like a robust, relatively simple solution that we won't have to code around later. It's fine if the solution is just visual, although a way to partially disable colliders would be nice too.

Another option we've thought of is rendering a second camera to a circle texture. With this solution, the circle would actually display a duplicated but altered set of game objects somewhere else in our scene. However, this apparently requires Unity Pro (which we don't want to buy yet). Any other ideas would be greatly appreciated!!

Thanks :)

Comment
Add comment · Show 5
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 Eric5h5 · Mar 25, 2012 at 11:58 PM 1
Share

You don't need Unity Pro for the last thing; you can use a depth mask shader and two cameras. See here: http://www.unifycommunity.com/wiki/index.php?title=ShapeWipe Also the second set of game objects don't have to be somewhere else, and it would be better if they weren't; just use layers.

avatar image armoredpokey · Mar 26, 2012 at 02:42 AM 0
Share

Hmm. That's a pretty cool script and thanks for sharing it (and writing it!). It might work for our project, though we'd have to hack it in the for loop to not actually fade out.

In terms of layers, do you mean:

  • creating two sets of objects in the same place, but with different visual appearance
  • having the main camera just render one set using layers
  • having the circle overlay camera just render the other set
  • That way the 3rd effect would just be the two copies of the same object (one with altered appearance), in the same place but on different layers, which would be perfect since we wouldn't need to hack around the colliders. The 1st and 2nd effects would just be special cases of the first, with a little collider hacking to disable collisions in the disappeared area.

    Am I understanding your suggestion correctly?

    avatar image Eric5h5 · Mar 26, 2012 at 02:55 AM 0
    Share

    The script is just a demonstration of the effect I was talking about; I didn't mean that it would work as-is for what you want. I expect you'd write a new script using that principle. As for layers, yes; also physics works with layers as well.

    Another demo of the depth mask/2 cameras technique: http://www.starscenesoftware.com/vectrositydemo4.html

    avatar image senad · Mar 26, 2012 at 07:59 AM 0
    Share

    BTW: Could you answer this as a answer ins$$anonymous$$d a comment? Because otherwise the question appears in the unanswered list.

    avatar image Eric5h5 · Mar 26, 2012 at 02:00 PM 0
    Share

    O$$anonymous$$, posted as answer.

    1 Reply

    · Add your reply
    • Sort: 
    avatar image
    1
    Best Answer

    Answer by Eric5h5 · Mar 26, 2012 at 01:59 PM

    You don't need Unity Pro for the last thing; you can use a depth mask shader and two cameras. See here: http://www.unifycommunity.com/wiki/index.php?title=ShapeWipe Also the second set of game objects don't have to be somewhere else, and it would be better if they weren't; just use layers.

    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 armoredpokey · Mar 27, 2012 at 01:03 AM 0
    Share

    thanks! the code you've shared is definitely full of new concepts and might take a little while to understand, but the general concept it implements definitely seems like the best way to go about things. im hopeful that we'll be able to finish our feature now :)

    avatar image armoredpokey · Apr 01, 2012 at 07:07 PM 0
    Share

    update: it works great, and the code ended up being quite simple. that Depth$$anonymous$$ask shader with the many-optioned subshader was crucial though, and we definitely wouldn't have come up with it without your help. thanks again.

    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

    Car Camera help needed please 1 Answer

    How to make camera position relative to a specific target. 1 Answer

    Changing the camera when clicked on a collider 1 Answer

    Smooth Camera 2 Answers

    Can't get this camera to collide with colliders... please help? 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