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
1
Question by Dreeka · Aug 03, 2011 at 12:00 PM · colliderparentgroup

Collider to parent

Hello,

I would like to add multiple meshes to an empty game object, then add a mesh/box collider to the parent. I have tried to add a box, or a mesh collider to it from the inspector, however the resoult wasn't covered the meshes, only a part of them.

How should I do it, or is it even possible?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by krotana · Aug 03, 2011 at 12:06 PM

Hello there, you will have to be more specific? You mean you want to randomly spawn prefabs to a location based on a empty game object by using an array?

You need to use an variable as var anObject:gameObject[];

and then give the settings to what you want the new objects to do.

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 Dreeka · Aug 03, 2011 at 12:37 PM 0
Share

No.

I have primitive game objects in the scene, and I have parented them to an empty game object. However I don want to add a collider to each of the child object, I would like to add one single big collider to the parent game object,

avatar image
0

Answer by krotana · Aug 03, 2011 at 03:36 PM

cant you add a script to the empty game object or go to Component>Physics>Box Collider?

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 Dreeka · Aug 03, 2011 at 04:17 PM 0
Share

It just adds a box collider with a size (1, 1, 1), without covering the objects.

avatar image krotana · Aug 04, 2011 at 02:58 AM 0
Share

did you try to increase the size? or you want something that keeps adding?

create a game object variable that counts in all the objects with a tag and then make an update that every time there is a new object with that tag, check the variable size and then create a box collider with the new specs. I am not sure how otherwise I can help you I am no good programer :)

check this link for collision scripts http://unity3d.com/support/documentation/ScriptReference/BoxCollider.html

and I just did this with deleting all objects of the same tag

var array : GameObject[] = GameObject.FindGameObjectsWithTag("taggedObject"); var item : GameObject;

 for (item in array)
 {
 Destroy(item);
 }

}

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How to collide children of a Rigidbody installed parent object. 0 Answers

How to detect child object collisions on parent 3 Answers

Multiple triggers on one object 8 Answers

Reaching a gameobject from its collider 3 Answers

accessing all of a colliders parents children 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