- Home /
Selecting custom game objects in Scene view window.
Hi guys.
I have designed a script to create a game object to act as a bezier spline, however the only way to select the game object is via the heirarchy.
If I try to click on the spline in the scene view (spline is only rendered in editor mode and is drawn using Debug.DrawLine after subdividing the spline into smaller pieces).
I was wondering if anyone could shed any light on why I cannot select the spline in the editor scene view and if there was any way I can enable this?
Thanks.
Answer by Loius · Dec 18, 2012 at 05:35 PM
In the OnDrawGizmos function (not the selected version), any Gizmo you draw should be pickable (clicking it selects the object).
You could draw an icon at the Spline's origin, or use Gizmo lines to draw the whole thing, for example.
Thanks for this, I will take a look at implementing it tomorrow.
Thanks again for the help!
Your answer
Follow this Question
Related Questions
How to select a hidden MeshRenderer in SceneView? 0 Answers
Access Scene View Selection Rectangle 0 Answers
DrawLine Is not doing anything. 2 Answers
DrawLine from enemy to player 1 Answer
Character Selection Menu for 2D Game 0 Answers