How can I create an editor object projection tool?

First of, this could maybe have been a forum post but I believe it fits better here. Please correct me if you disagree.

At Exit Strategy Entertainment we like optimising our workflows, even beyond what Unity offers out of the box. One of the things are currently struggling with is if it would be possible to create tool which allowed for easy placement of objects in the Unity editor.

When dragging a gameobject from the project view to the scene Unity (as of 3.0 I believe) automatically projects object to a surface which is wonderful. We would like to use this functionality also when moving around objects which are already in the scene.

  • Is there functionality for this already?
  • Would it be possible to extend the editor with a such tool?
  • Is it possible to listen to mouse events in the editor scene viewport?

I’ve had a look at the editor scripting documentation and there does not appear to be any exposure of the functionality already in Unity which I would love to hook into.

Yes, you can do just about anything you can think of with an editor script, including raycasting and bounds checking (which would be all you really need for what you’re trying to do).

However- Since you guys are keen on simplifying workflows, I might point out that unity has already thought of this. Once an object is already in the scene, you can ctrl+shift+drag and it will stick to the ground. On a related note- you can ctrl+drag and it will snap to the grid.

Guess I need to RTFM some more! Thanks guys :slight_smile: