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
0
Question by vidjogamer · Aug 13, 2013 at 09:59 PM · meshrendererskin

How do I render a collider?

So what I am trying to do, is be able to visualize my collision data. I have an animated model, and have colliders in my scene, and I want to be able to SEE the actual colliders to debug collision problems in my game. It would be even better if I could assign different materials to different types of collision shapes in my game. I understand the conventional way to render in unity is with a renderer. Is there no debug drawing functionality to visualize collision boundaries? Most physics engines have debug drawing capabilities. Heres an example of the functionality I would like to achieve within unity: http://images.search.yahoo.com/images/view;_ylt=A2KJkPoMsQpS_EAARUOJzbkF;_ylu=X3oDMTFxZHE5cHIzBHNlYwNzcgRzbGsDaW1nBG9pZAM1Zjk5ZDA0MDlkZGQxYTRlZTUzYjhkMmQ4N2YyMTFmMARncG9zAzE-?back=http%3A%2F%2Fimages.search.yahoo.com%2Fsearch%2Fimages%3Fp%3Ddebug%2Bdraw%2Bogre%2B3d%26n%3D30%26ei%3Dutf-8%26y%3DSearch%26fr%3Dchr-greentree_gc%26tab%3Dorganic%26ri%3D1&w=300&h=234&imgurl=www.ogre3d.org%2Ftikiwiki%2Ftiki-download_file.php%3FfileId%3D2055%26amp%3Bdisplay%26amp%3Bx%3D300%26amp%3By%3D234&rurl=http%3A%2F%2Fwww.ogre3d.org%2Ftikiwiki%2FDebug%2BDrawing%2BUtility%2BClass&size=30.8KB&name=%3Cb%3EDebug+%3C%2Fb%3EDrawing+Utility+Class&p=debug+draw+ogre+3d&oid=5f99d0409ddd1a4ee53b8d2d87f211f0&fr2=&fr=chr-greentree_gc&tt=%3Cb%3EDebug+%3C%2Fb%3EDrawing+Utility+Class&b=0∋=96&no=1&ts=&tab=organic&sigr=11qs8mjkk&sigb=13tvs1u30&sigi=12q9bidvj&.crumb=UwFcCtv0tGc&fr=chr-greentree_gc

They of course are using Ogre3D, but being able to visualize the collision shapes would make things much easier for me.

Comment
Add comment · Show 2
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 Joyrider · Aug 13, 2013 at 10:51 PM 0
Share

When you ask a question, take the time to explain clearly what you want, and why. This can really help us along to get you where you want... And tag your questions correctly, with relevant keywords , or at least those that have an obvious relation to your question.

avatar image DaveA · Aug 13, 2013 at 10:58 PM 0
Share

What a mess. PLEASE learn how to use and post questions, comments, and answers here.

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by HolBol · Aug 13, 2013 at 10:01 PM

You can't. Colliders, and renderers are different things. What you could do is use the same mesh for the collision as the rendering, but as I see you're using the SkinnedMeshRenderer, then you need to do collision as a separate object.

Comment
Add comment · 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
0

Answer by YoungDeveloper · Aug 13, 2013 at 10:36 PM

You can attach a mesh collider to any mesh and it will create a collider in that same shape. And at the start disable that objects mesh renderer, so you wont be able to see the object but actually collide with it. And On collision or trigger you could enable the renderer back on. So it will look like if you collide with it you will see it.

Good luck.

Comment
Add comment · 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
0

Answer by DaveA · Aug 13, 2013 at 11:00 PM

You can use Debug.DrawLine if you want it just in the editor scene view. Otherwise use a LineRenderer, GL, or Vectrosity would be my suggestion, and interpret the type of collider you have and its parameters to know how to code the drawing of it. But note that colliders are rendered as green wire frames in the editor scene.

Comment
Add comment · 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
0

Answer by MrCowKing · Jun 27, 2014 at 01:02 AM

Have a look at my plug-in: https://www.assetstore.unity3d.com/en/#!/content/18120

It can draw any type of collider that you want and more.

Comment
Add comment · 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

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

20 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

Related Questions

Combining Skinned Meshes 3 Answers

Skin modifier 3Ds Max Problems 2 Answers

Changing two different objects renderer colour 1 Answer

Android performance problem on model joints(Rig). 1 Answer

Mesh renderer properties 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