• 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 Arctic_Evolution · Jan 16, 2018 at 10:56 PM · gameobject

Dealing with Object Structure with prefab parts making the whole as a parent body to interact/interface

I have many structures built with multiple prefab parts, this might be a house with all the various walls, doors, and windows. I wish for the player to interact with the house as a whole more than the parts, and it will be this way for similar objects in the game, as it is more of a top down strategy game, that the view can swivel a bit with the 3d experience. The parent object, example "the house" I wish to be highlighted and interacted with. Often one side wall is made up of 3 parts itself. As you can see it would have no function for the player to be interacting with a 1/3 of the wall, let alone the whole wall in my game.

This then is the drama I am finding. It seems very difficult to place mesh coloring code around the parent object that has no mesh of itself. Or shader of itself. Because it is an empty gameObject to hold the children, who some of them also have children. Most of the parts do use the same textures. Ie. each wall of the house. I considered if there was a way for Unity to combine them, or merge them for this. I investigated accessing the childrencomponent, and that was easy enough to change the color of them all, but this appears hard, when to take record of original texture, or detail, when I am doing mouseOver On and Off. So that when Mouse is Off, the color of all the children go back. The code to store every child color that was, seems to be very involved and bloated, that it gave me a toothache thinking about it.

I then was pondering later, perhaps the only easy solution, is to create a new object about the size of my ExampleHouseWithManyParts, and overlay that object as an invisible object, so that would be the object highlighted, mouseOver, so it would make it appear like the object it was around was highlighted, by itself being highlighted. [=my current solution to deal with this]

Allow me to make this easy visually.

  • +Heirarchy

  • ++Large House

  • Child 1 Wall

  • Child 2 Wall

  • Child 3 Door

  • Child 4 Window

Player will look down with camera and see the Large House, and he will be interacting with the Large House in the game, to be able to highlight the whole house with the pointer, and then click on it, have menus etc. Though this moment I am finding it hard enough to have an easy solution for the whole House to Highlight and then revert. Changing the color of all is easy (to highlight all), but then the conundrum of having all the children to go back to their originals, once mouse is Off. Thus I came to my crude solution of having a new object there the same size, for the ease, of adding a color to one object and taking it off again on MouseOver on/off without the aforementioned drama of dealing with every child component.

The question I am asking, is how do you people deal with these situations? Is there better solutions for this?

(I had no idea what to put this under topic of, I chose GameObject as the closest pick. And Captcha, I hate you. When I edit my post for the umpteen spelling error, you are not there, and I click save, and only then do you appear the next time. No the characters did not match the image, because you did not show it to me in the Edits, until I clicked save)

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

0 Replies

· Add your reply
  • Sort: 

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

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

using Contains(gameObject) to find and destroy a gameObject from a list 2 Answers

Projectile not 'projecting' because i have to use "var xxx : GameObject = Instantiate" 2 Answers

Position and rotation of a game object acting wired 0 Answers

Reference creator of gameObject 1 Answer

About Destructible 3d objects 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