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
2
Question by jacksmash2012 · Feb 03, 2011 at 06:57 PM · circle

How to draw a 2D circle on a GameObject?

For example, consider if someone wanted to draw a pie graph on some terrain. But the graph lays on top of the terrain. In my case, I just want to draw a circle on top of a Cube.

I suppose I could draw a 3D disc if I had to. Any thoughts?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by e-bonneville · Feb 03, 2011 at 07:07 PM

You could use a projector placed above the cube or you could manually place a plane with the pie graph texture on it directly above the cube.

However, if all you wanted to do was simply draw a solid circle of one color, you could create a cylinder gameObject, set the Y scale to something like .01, place that cylinder above your cube, set the material's color to whatever color you need, and scale that using Vector3.Scale.

Comment
Add comment · Show 16 · 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 jacksmash2012 · Feb 03, 2011 at 07:11 PM 0
Share

The only problem with using a texture is that I want the circle to be able to grow/shrink as the user moves a slider.

avatar image jacksmash2012 · Feb 03, 2011 at 07:12 PM 0
Share

But I'll try the Projector approach.

avatar image jacksmash2012 · Feb 03, 2011 at 07:16 PM 0
Share

Hmm... so what if I use the Projector approach but still want a circle to grow/shrink? Is this going to be possible?

avatar image e-bonneville · Feb 03, 2011 at 07:26 PM 0
Share

Yup, all you have to do is set the projector to orthographic, then change the projector's A) height above the cube or B) orthographic size. Here's the script reference for projectors: http://unity3d.com/support/documentation/ScriptReference/Projector.html

Also, don't forget to accept and upvote this Answer if it works for you. ;)

avatar image jacksmash2012 · Feb 03, 2011 at 07:27 PM 0
Share

Thanks! And don't worry, I won't ;)

Show more comments

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

1 Person is following this question.

avatar image

Related Questions

Drawing Sector around GameObject in GameView: GUITexture or 3D Object 1 Answer

Circling around a target while maintaining direction of facing 0 Answers

2D Aiming with a mouse angle problem 1 Answer

Draw only part of a circle 0 Answers

Prevent Object from going out of Circle Radius 3 Answers


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