godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.71k stars 21.12k forks source link

Selection in Spatial View doesn't work with instanced objects/scenes #2852

Closed SirPigeonz closed 7 years ago

SirPigeonz commented 8 years ago

As in title, also new ALT + RMB selection menu doesn't work with 3D instanced objects/scenes for the same reason probably.

nunodonato commented 8 years ago

I still get this problem in 3d scenes, very unstable behavior, sometimes I can select but most of the times I can't and need to use the list.

nunodonato commented 8 years ago

so.. can this be re-opened? the problem is definitely not fixed

akien-mga commented 8 years ago

Not critical for the upcoming 2.1, so moving to the next milestone.

sketchyfun commented 7 years ago

I've been looking into this issue myself and I've discovered it's not specifically instanced scenes which are causing the problem. Certain node types aren't directly selectable by clicking in the viewport as they do not have a spatial gizmo associated with them, and this is used in the selection process. Things like StaticBody, KinematicBody, Spatial are among these, and so if the root node of an instanced scene uses one of these node types, you will not be able to select them in the viewport. However, if your instanced scene has a root node of say MeshInstance (one of the node types that does have its own spatial gizmo type) then you will be able to select that instanced scene.

brenttaylor commented 7 years ago

This is a pretty big workflow issue. Any information as to when someone might tackle this?

reduz commented 7 years ago

I seriously don't understand what the problem with this is

sketchyfun commented 7 years ago

What's actually causing it, or the issue itself?

reduz commented 7 years ago

I don't understand what the issue is

sketchyfun commented 7 years ago

Basically certain 3D nodes aren't selectable via clicking or drag selection in the 3D viewport. For example, if you add a Spatial node to the scene, you can't click on it via the 3D view (obviously, it has no shape, size or collision info for the mouse to raycast against), but this also extends to things like a RigidBody or KinematicBody, which inherit their collision information from a child CollisionShape.

If you add a RigidBody to the scene and then try clicking on it in the 3D view, you can't. If you add a CollisionShape as a child, then only this is selected if you click on it in the 3D view. All of this makes sense until it comes to instanced scenes.

If you create an instanced scene and the root node is something that has no collision information, i.e Spatial or a StaticBody (or any physics body, even if it has a CollisionShape child), then when this node is instanced in another scene, the item is not selectable via the 3D view.

I'm not sure how best to solve this, other than maybe these nodes can get their editor collision info from the child if it has it?

reduz commented 7 years ago

@sketchyfun I don't think this is a problem per-se but in 2D you can make children not selectable and always force the selection of the parent. Likewise if you are using instance and children are not edibable, it will select the instance root.

I personally think it's better to leave this as-is than adding hacks, as generally instancing solves this problem, but any ideas welcome.

reduz commented 7 years ago

since this is clearly not a bug, marking as enhancement and kicking to 3.1 unless anyone comes up with a good idea

sketchyfun commented 7 years ago

Instancing doesn't solve the problem though, this is where the issue is actually most problematic.

If I make a scene, say a building, like this:

O StaticBody --------> O CollisionShape --------->O MeshInstance

..and then save it and instance it in another scene, even though I can see the building in the 3D view, clicking on it will do nothing and the only way to select the instanced scene is via the scene tree

Jakob-PB commented 7 years ago

@reduz I made a video for you, explaining what the new user experience currently is like and some general workflow feedback.

The release of version 3 of Godot is a big chance for the engine to gain some much needed recognition that it deserves. However, if this fundamental workflow issue isn't fixed by then, I'm afraid once again everyone will declare it's not ready for 3D yet (and first impressions are important). If this alpha period is for workflow improvements then I honestly think this particular issue should be escalated to a top priority. Yes it's that important. Especially as a scene grows in size and complexity this makes editing scenes in Godot a nightmare. As you can see in the video, even in the trivial 3D Platformer demo it still causes a fair bit of slowdown in my attempt at modifying the scene.

The ideal solution would be implementing a selection system that selects the scene instance if you click on any visible node attached to that scene instance. The selection system should not be dependent on colliders, it should be dependent on clicking the mesh itself (i.e. what the user can actually see in the viewport and click on).

Please consider moving this back to the 3.0 milestone so that everyone has a great user experience with the official release and wants to stick with the engine. I fear they won't come back if none of this is addressed until the 3.1 update.

sketchyfun commented 7 years ago

I also feel this should be pretty high priority, as I've experienced the issue first hand while working on my current 3D game. The only way I've been able to get around it is by making my instanced scenes have a root node that is selectable via the 3D view, but this isn't always possible. In the end I ended up modifying the engine with a hack that gives usually un-selectable spatial nodes a 1x1x1 collisionshape, just so I had some method of selecting them in the editor, which made it more usable even if it wasn't perfect.

coppolaemilio commented 7 years ago

I also feel the need for this feature to be implemented in 3.0 having a good relationship with the nodes is the main goal for the on-boarding experience. The video made @TacoShank is a pretty good way to understand the way of thinking of a new user.

Stajin commented 7 years ago

I have to agree that this is an important issue, it should at least grab the whole instanced scene when you click an element that's within it. Don't get me wrong, I'm not saying make it like a lumberyard style slices system (Like a prefab + alterations stacking kind of thing) for 3.0, but at least give the user the feedback.

As in, you clicked this thing, it's part of this instanced scene, now you've selected that instance, rather than (as the youtube video shows) giving the feedback of... here, you can't choose this, now figure out why. Plus (in my opinion), it'd be more convenient.

And great job on 3.0 so far btw, it's looking very good, and as a new comer to Godot, I really appreciate the effort you guys have put in making it so intuitive.

asusralis commented 7 years ago

I don't mean to sound dramatic, but how isn't this a top issue? The video @TacoShank made perfectly sums up some major problems with level designing in Godot, and makes development in other engines that has basic editing functionality - like UE4 and Unity - much more appealing.

sketchyfun commented 7 years ago

I think @reduz is under the impression that it works the same way as in 2D when the scene is instanced, but that's not the case with 3D at the moment

Stajin commented 7 years ago

I expect it's more due to the fact that right now he's playing whack a mole on so many issues that he may not have had time to actually watch the video, the poor guys swamped with work.

Hopefully this issue will get solved for release though, as it appears to be a pretty big issue in terms of usability in my opinion.

SirPigeonz commented 7 years ago

I must agree that inability to select "stuff" in 3D viewport is really big issue. I'm also a bit worried that it might leave very strong bad impression for people who will try 3.0 :(

nunodonato commented 7 years ago

+1 for this. not being able to select 3d objects in a 3d game is infuriating, to say the least.

brenttaylor commented 7 years ago

@reduz Take a look at #9145 as it explains the issue rather well. This is a huge workflow issue and the only reason I avoid Godot for 3D projects. Godot is amazing and for 2D projects saves me significant amounts of time as a single developer. It's unfortunate that most of that time is lost when working in 3D.

ghost commented 7 years ago

This is still not working with instanced group of objects, so can someone re-open this issue?

Example: I have a group-of-trees scene which is made of a couple of trees (tree has it's own scene, of course), and when I instance the group-of-trees, I can't select any of those trees.

Also see this post which reports a zoom-dependent behavior.

akien-mga commented 7 years ago

10209 did solve the issue in at least several cases, so I think it might be clearer to open a new issue with details about the current behaviour, than reopen a 2015 one.

ghost commented 7 years ago

Actually #9145 is still open, so I guess I'll just write it there