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 zpinner · May 19, 2012 at 04:06 PM · editortriggerboundingbox

Always show trigger on Editor

Hello, is there a way to set unity to always show the triggers on editor view?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by ArmarageX · Aug 05, 2012 at 04:51 PM

Perhaps an alternative way would be:

1) Make sure your scene rendering mode is [Tex - Wire] (under the scene tab) 2) Add a MATERIAL to the box you are using as trigger. (You may have to import a package that contains materials) 3) Go to the Material Component to change the colour of the material, and turn down the ALPHA (R G B Alpha) 4) You may also need to change the Shader type (the dropdown option) to a Transparent Shader (ie Transparent Diffuse).

So the trigger would be just a box with a semi transparent material on it., and you can see its wireframe as well due to the Textured / Wireframe rendering mode.

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 zpinner · Aug 06, 2012 at 02:59 AM 0
Share

Thanks ArmarageX, I'll try it. I'll let you know if it worked.

avatar image
0

Answer by Berenger · May 19, 2012 at 04:12 PM

I don't think so. However, you can create a script that draw a gizmos if a collider is a trigger. You just need to attach it to every colliders. It's more convenient to create a static function with MenuItem that search all the triggers and add your component if there isn't one already.

Comment
Add comment · Show 4 · 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 zpinner · May 19, 2012 at 04:27 PM 0
Share

But then I'd need to have the game running in the editor, right? I'd like to see all my triggers in design time.

avatar image FLASHDENMARK · May 19, 2012 at 04:45 PM 0
Share

If you revert this to a comment, I'll tell you.

avatar image zpinner · Aug 06, 2012 at 02:55 AM 0
Share

you don't have to. If it bothers you, I can change it.

avatar image reptilebeats · Aug 06, 2012 at 04:49 AM 0
Share

you need to research Execute in edit mode and then right a script that will draw lines along the edges of the trigger. easiest way would be to make a single script that you have to attach onto each trigger and have them all deactivate when built.

but if you have been coding for a while then you could probably do something a lot better and less time consu$$anonymous$$g.

avatar image
0

Answer by sandbaydev · Sep 05, 2013 at 04:05 PM

Old question but since it was relevant to me, answering. If you have a simple cube as the trigger zone, then you can assign script like this to the trigger zone (once loaded, it will destroy the MeshRenderer component):

 using UnityEngine;
 using System.Collections;
 
 public class TriggerZone : MonoBehaviour {
     
     void Awake() {
         Destroy (GetComponent("MeshRenderer"));
     }
 
     void OnTriggerEnter (Collider other) {
         Debug.Log ("Object entered the trigger zone", other);
     }
 
     void OnTriggerStay (Collider other) {
         Debug.Log ("Object staying in the trigger zone", other);
     }
 
     void OnTriggerExit (Collider other) {
         Debug.Log ("Object exited the trigger zone", other);
     
     }
 }
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

8 People are following this question.

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

Related Questions

Unity's Bounding Box 0 Answers

Can't click gameobject when over another trigger? 1 Answer

Manually triggering a script from the editor (utility, macro etc.) 1 Answer

How to create a controllable output for triggers? 1 Answer

How can I set a selection-sphere in the editor 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