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 fherbst · Aug 12, 2010 at 10:59 PM · gameobjecteditorclickable

Clickable empty GameObject in the editor

Hi,

EDIT: I already found a solution (see below).


I want to create some waypoints, and I want to be able to select them in the editor window. Currently I use empty GameObjects with a Waypoint script attached, which draws gizmos for them. But I cannot select them in the Editor, because there is nothing to select (no geometry, only the gizmo).

But I want to be able to select them in the editor, like one can select a camera object. Does anyone know a solution to this?


EDIT: Like always, I found the solution right after I posted the question. It seems that Gizmo.DrawCube is not clickable, but Gizmo.DrawIcon is - I don't quite know why, but okay, now it works. If someone knows WHY this works this way or how to have a clickable Gizmo.DrawCube - thats the question know :)

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
Best Answer

Answer by fherbst · Nov 02, 2010 at 09:27 AM

Solution found, see EDIT in my question. This answer is just to clean things up (so everyone looking for it can find it solved).

It seems that Gizmo.DrawCube is not clickable, but Gizmo.DrawIcon is.

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 AlanChatham · May 19, 2011 at 06:21 AM

I've found that by attaching a mesh to my waypoing object, I've been able to select and move it around inside the editor with clicking/dragging.

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 DapperDirewolf · Feb 16, 2018 at 05:42 AM

Unfortunately this answer didn't work for me - though I'm not sure if it's because I used a custom Gizmo icon or not.

My alternative which seems to be working pretty well is as follows:

Using a 3D / 2D mesh renderer (I used a 3D Sphere Mesh with a flat white material - though a Sprite Renderer will probably work just as well) I am able to select and manipulate the Waypoint as easily as any other object.

Then, in the script I use to manage my waypoints, I loop through every instance of a waypoint and then Destroy the MeshRenderer component on void Start (). This means that while the mesh component is visible in the editor view, all are destroyed immediately upon scene launch and therefore not visible to the player.

Hope this helps somebody!

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 IamThe_Guy · Feb 20, 2018 at 04:30 PM 0
Share

I am working on my own (similar) solution that quickly allows me to make levels for my space invader game and while I am not finished, I am working on my own editor for my waypoints (I call them nodes, still new to na$$anonymous$$g conventions), and that's where I started running into issues when I wanted to save/edit/test, my code was getting too complex too fast with my previous setup with serialization. Which eventually lead me to the path (pun intended) of creating my own system separated from unity easy to serialize to keep these simple for myself, but interfaces with it quite nicely. I keep a static Dictionary of my nodes, with a static Dictionary of paths that correlates with the nodes in the node Dictionary. The only time the points are represented as gameobjects is when I am using my own editor to edit the level and place nodes. This system also allows me to load and save points and paths without converting gameobjects to an ordered list of nodes, when they can just be nodes and only be converted to gameobjects when level editing. However I do intend to add node gameobjects that are "smart" nodes, but only if they requires the power of a gameobject. I learned to compartmentalize everything, and only use unity when you have to if it can be done outside of it! Hopes my recent insights help!

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Select un-selectable Objects with mouse. 1 Answer

Use for loops and still assign gameObjects in editor 1 Answer

Objects created in Editor script lose their reference after Play/Stop? 1 Answer

Mark gameobject field as changed from prefab 2 Answers

Initializing List of generic type via editor - Doesn't work? 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