• 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 Charles_Gams · Mar 30, 2013 at 05:34 AM · gameobjectcollider

Refer to another gameobjects collider in script

How do you refer to another gameobjects collider in script so you can resize its eg// radius , height etc

Comment
Add comment · Show 3
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 David Kamunyu · Mar 30, 2013 at 05:44 AM 0
Share

What is it that you are trying to get done? Like when 2 objects meet, one of the colliders grows, shrinks etc?

avatar image Charles_Gams · Mar 30, 2013 at 05:47 AM 0
Share

I've got a bounce attack feature just like in sonic the hedgehog and it works , however it doesn't loop all the time because the radius of the bounce attack or colliders radius stays the same.

The bounce attacks radius is another gameobject that has a sphere collider. I want to reference that gameobjects sphere collider radius in another script thats not attached to the gameobject if that makes sense

avatar image Charles_Gams · Mar 30, 2013 at 05:50 AM 0
Share

when i say not attached to the gameobject i'm basically stating theres two hopefully that clarifies everything

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by David Kamunyu · Mar 30, 2013 at 07:04 AM

For the most part I understand, so I will try and make a slightly different suggestion. Would it still work how you want if you were to create a new GameObject under the parent GameObject like the parent is "BadGuy" and the child can be called "AttackCollider" for example, and you add the component collider to AttackCollider in the inspector, and take away the collider in the parent (basically exchange the collider from the parent to the child). That way, to reference it, all you have to do is reference the AttackCollider GameObject.

Make sense?

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 Charles_Gams · Mar 30, 2013 at 01:09 PM 0
Share

Oh yeah that makes sense and i see a possible solution isit possible if you show an example or a link to something that shows an example

avatar image David Kamunyu · Apr 02, 2013 at 09:57 AM 0
Share

I'm sorry I don't quite have the time to make an example project, and the idea was pretty much from the top of my head but if you have some code, you can put up the section you need help with, and I'll try and help where I can

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

12 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

Related Questions

OnCollisionEnter Collision not detected? 1 Answer

Get the script instance associated with a collider 1 Answer

Translate.transform problems (collision/Rigibody) 0 Answers

Why do Instantiated GameObjects Colliders only work on player i am controlling,nothing else? 2 Answers

Struggle with vollider detection 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