Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 gaaaalvez · Jul 10, 2015 at 01:35 PM · renderingcolliderstower-defense

Is there a way to render in-game a sphere collider?

I'm trying to show the collider of a game object as in any tower defense game where you can see the range of each tower. Anybody knows if this is possible? Or some other solution I can use?

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 Owen-Reynolds · Jul 10, 2015 at 03:14 PM 0
Share

Collider is a confusing word for this. It sounds like you just want to draw a big circle-edge. Does "unity draw edge of circle" really have no hits?

I've never seen a Sphere used for "how far this gun can shoot." Do you really want 3D? A big hollow ball around the gun?

avatar image gaaaalvez · Jul 10, 2015 at 04:12 PM 0
Share

$$anonymous$$aybe I'm approaching this the wrong way. I'll take a look at the shaders though. Thanks.

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by _Gkxd · Jul 10, 2015 at 02:50 PM

Edit:

Unfortunately, the method I posted using Handles won't actually work in a build. The easiest alternative solution that I can think of is to render an image of a circle where you want. If you want a very high quality circle, you can manually create a polygon mesh and render that.

Comment
Add comment · Show 5 · 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 Cherno · Jul 10, 2015 at 03:39 PM 3
Share

You can use Handles in an actual game by including UnityEditor at the top of a script.

Correct me if I'm wrong, but I'm pretty sure that you can't successfully build a game if one of the included scripts (those outside the Editor folder) use UnityEditor.

avatar image _Gkxd · Jul 10, 2015 at 03:55 PM 0
Share

I was not aware of that. I was using it in a few things to draw bezier curves, but I never tried building with it. Thanks for letting me know.

avatar image tanoshimi · Jul 10, 2015 at 04:01 PM 0
Share

@Cherno - you're not wrong :)

avatar image gaaaalvez · Jul 10, 2015 at 08:48 PM 0
Share

Thanks, I'll give it a try

avatar image GebhardtXR · Mar 31, 2021 at 09:18 AM 0
Share

Can you please share the method?

avatar image
1

Answer by Cherno · Jul 10, 2015 at 02:52 PM

A collider ultimately uses a normal mesh, so if you want to view this mesh, you could, for example, use it as the mesh of a MeshFilter and add a MeshRenderer on top of that. Depending on your needs, you could use a special shader that is transparent or whatever to show a tower's range.

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 GebhardtXR · Apr 01, 2021 at 10:20 AM 0
Share

How do you get the mesh of a collider?

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

object collision does not work 2 Answers

Enable tree colliders near you, far ones are disabled 0 Answers

Tower Defense - Making the Player move only spesific places 2 Answers

Cloth Rendering issues and Cloth Colliders 1 Answer

physics.OverlapSphere colliders 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