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
1
Question by darbotron · Sep 04, 2010 at 11:52 AM · gameviewcheck

Is there any way to get Debug.DrawLine() to display in the game view without other gizmos?

Hi

I have a (relatively small and totally work-aroundable) problem, but I'm just wondering if there's a simple check I can do to fix it...

I want the lines rendered by Debug.DrawLine() to appear in the Game view. Simple. Press the Gizmo button on the game view and they display...

The problem is that all the gizmos (mostly object setup related) I have then also render and get in the way of what I'm trying to see when I use Debug.DrawLine().

Is there any way to:

a) cause Debug.DrawLine to render in the game view without the Gizmo button turned on?

b) check which view (scene or game) is active so I can not render the gizmos in the game view?

cheers,

darbotron

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
-1

Answer by StephanK · Sep 04, 2010 at 12:07 PM

You can check if you're running in the editor with Application.platform. I don't think you can turn on Debug.DrawLine separately, but you could draw your lines with another method that works in game.

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 darbotron · Sep 04, 2010 at 08:17 PM 0
Share

Hadn't thought of Application.platform, but it's not really a lot of use TBH.

I don't really want to spend any unnecessary time messing with what would amount to implementing my own version of debug.drawline using LineRenderer or the GL rendering class unless I have to.

Thanks anyway.

avatar image
0

Answer by Statement · Dec 15, 2010 at 05:40 PM

You can use LineRenderer to render lines. Then you can check Application.isEditor and only draw during that condition.

The editor doesn't really have any options for what you're trying to accomplish so it's going to have to be custom made.

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

No one has followed this question yet.

Related Questions

How to Choose Camera for Game Window 2 Answers

Game preview different from scene,Game preview different than camera and scene preview 0 Answers

Game view scale on compilation/play 5 Answers

My game shows weird errors in game view 1 Answer

find object in game view 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