I would like to know if there is some way in Unity to mark a mesh as locked or unselectable so that during population of items I don’t keep grabbing and sometimes accidentally moving the terrain. Anyone know if this is possible and how to go about doing it if it is?
Well I can’t say that I am too thrilled with the lack of that functionality, but maybe it will get added in the future. I am, however, very grateful to have seasoned Unity users like yourself who take the time to answer questions. Thanks!
The lack of a lock is fairly annoying once you have lots of geometry, but it should be possible to fake some of that functionality with editor scripts and a specialized component or so.
I was going to ask for this too (lock button next to object) Instead I’ve been doing everything in Maya, and locking it there and re exporting. Little workaround, but it works.
Ok, wrote a script to do it on my end; it’s apparently almost built-in to unity, just not exposed. Can’t post entire script as it’s mixed up with other stuff, but the code looks roughly like this:
if (GUILayout.Button("Lock"))
{
if ((int)Selection.activeGameObject.hideFlags == 0)
{
Selection.activeGameObject.hideFlags = HideFlags.NotEditable;
}
}
if (GUILayout.Button("Unlock"))
{
if (Selection.activeGameObject.hideFlags == HideFlags.NotEditable)
{
Selection.activeGameObject.hideFlags = (HideFlags)0;
}
}
Put it in an editor window somewhere.
You can still select the level by accident, but you won’t be able to move it and all the properties will be grayed out.
It’s a place where you can go log feature requests, or vote for others you find interesting (you have limited votes so use them wisely!). Please understand that we won’t be slaves to this list in any way, but we will use it as a solid source of feedback about where the product needs change and improvement so add your thoughts!
BTW, I get the sentiment here, locking of items would be nice indeed. Don’t confuse my factual response with a lack of understanding.