• 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 BrewNCode · Apr 09, 2018 at 12:48 PM · colorhue

opening doors by combining two colors.

I have a project and consist of opening doors with runes that have a color. We know how to open doors collision but I don't know how to blend 2 colors into one and then make the door open. For example, you encounter a purple door, so you have to find a blue rune and a red rune. How can we have a sort of blender that when we put the 2 runes the purple door opens?

Comment
Add comment · Show 1
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 Gruffy · Apr 09, 2018 at 01:04 PM 0
Share

Hi, hope you are well. If you wish to open a door based on the collection of two items, I would suggest writing a conditional that satisfies this. $$anonymous$$nowing nothing about your game what so ever...

It would be prevalent to create two objects that could receive your rune objects, say something graphical that can house the objects for visual pleasures.

Then, you might look into OnCollisionEnter or OnTriggerEnter, checking for (player) ownership of the correct objects per "Rune-receiving -object". [Blue Object receiver has blue object?] [Red Object receiver has red object?] [Both Receiver objects have correct runes objects in correct places?]] [Open Door] Now code wise, if this is what you would like I can write this and get back to you but first I need to know if this is the basic algorithm per say and also if you would like it written into your existing game objects perhaps you can pass these into your question here so it can be downloaded and adjusted accordingly. I am here for today only if you wish to get this resolved and moved into an answer:) Take care bud :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Topthink · Apr 09, 2018 at 02:32 PM

Without knowing more about the mechanics of your game it would be difficult to answer. The first thing that comes to my mind is to have an "OnCollisionEnter" (etc) that executes a function that opens the door. This results when one collider/rigidbody contacts another collider/rigidbody. See this link: https://docs.unity3d.com/ScriptReference/Collider.OnCollisionEnter.html.

I hope this helps. Good luck in any event.

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 BrewNCode · Apr 10, 2018 at 02:39 PM 0
Share

Can the OnCollision enter hold 2 variables, so I need 2 game objects to open the door?

avatar image BrewNCode · Apr 18, 2018 at 12:22 AM 0
Share

Hello, @Topthink I wanted to say that we actually implemented a crafting mechanic. Well, the mechanic of this is pretty simple if you think about it, let me explain myself: The game is about finding runes that have certain colors (blue, red, green, then it will come more difficult, bare with me). You will have different doors and you have to match AT LEAST 1 rune with their respective color to go to the next level. In the next levels you will have to combine runes with different colors to have acquire new runes of different colors (blue + red = purple rune, yellow + red = Orange rune, so one and so forth) For this we created a crafting mechanic which helps us to create new runes just by combining and destroying remaining runes that we have. The problem now is, How to open the door which recognizes the rune color? That is my new impasse.

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.

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

78 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 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

Adjusting hue/tint for material color? 1 Answer

mantain color brightness and change only hue 5 Answers

Easily recolorable Button background textures 1 Answer

Material doesn't have a color property '_Color' 4 Answers

Changing two different objects renderer colour 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