Glitch in edit mode involving ragdolls - instant deselect

…At least I think this is a glitch.

tech info:
-Using Unity indie 2.6.1f3 (31223)
-Windows machine running Windows 7

background info:
I’ve got a ragdoll that I made in Unity by copying the structure for the Lerpz model and then using the ragdoll tool. Elbows are children of shoulders, Knees are children of Hips, there’s a torso, everything sits inside the Root, etc. I don’t think I screwed anything up there, because it was working fine for a while. However, something recently has caused a weird bug: my ragdoll Root is a prefab, called “Root” (surprising!) and though I’m instantiating it through scripting, I often need to drag it out into the scene to tweak it and add other game objects to the Root before dragging it back into the prefab.

the bug:
Lately when I do this, I click on the prefab in the Hierarchy and it instantly deselects. For any other game object, you click it and it stays highlighted with the blue background until you click something else, but with my Root prefab it just “blips” for an instant. Furthermore, if I try to drag it around in the scene using the translation/rotation/scale gizmos, it also instantly deselects.

If I expand the Root prefab and select one of the child game objects, that actually stays highlighted, but then if I try to edit any of the values in the inspector for any of the children, it instantly deselects. Say I clicked on the “X position” field for the elbow of my Root - I would be able to highlight the existing value, but as soon as I hit any single number key on the keyboard, it deselects, causing the inspector panel for that GO to disappear.

This also makes it practically impossible to remove the Root from the hierarchy - how can you delete it if you can’t click on it?

What I’ve tried:
-restarting Unity: this actually fixes the problem, except that once I make my changes to the prefab, “re-prefab” it, delete it from the scene, and then press play, the problem will come back the next time I try to drag the root prefab back out.

-restarting my computer: no improvement.

-reimporting the Root: no improvement.

-reimporting all: no improvement.

other thoughts:
The way my game is set up, the ragdoll cannot collide with anything. So I checked “isTrigger” for every collider in the ragdoll. This worked fine, until it started interfering with some raycasting, and since I wasn’t trying to use the triggers for anything, I just completely removed all of the colliders. This bug showed up the same day I did that, but I’m not sure if it’s what caused it. Is there some rule about using joints on rigidbodies without colliders? Thinking this might be the case, I re-added new colliders for every game object, but that didn’t fix it.

one last question:
If there isn’t some obvious answer here, the next thing I’m going to try is to just rebuild the whole ragdoll, but I have a question about that too: Since I suck at 3D modeling, I’ve been trying to make (nearly) every asset in my game out of primitives - I’m going for a simple, cartoony style anyway.

But when I built my original ragdoll, it came out slightly awkward - some joints were at funny angles - nothing huge, it wasn’t immediately obvious, but it wasn’t quite right and I had to do a bunch of minor tweaks even though I had arranged the parts of the model in very precise positions and copied the Lerpz hierarchy exactly.

I noticed that the tool said to make sure my model was in “T-stand” but I don’t know what that means and couldn’t find the answer through Google. I assumed it was sort of like making a “Jesus on the cross” pose (sorry I don’t mean to offend, that’s the only analogy I can come up with). Is this right? Is there some place to get more info on building a ragdoll entirely in Unity?

Sorry for the long-winded post, I’ve been holding off on registering and asking this question, but I’m getting just a tad frustrated with constantly having to restart Unity every time I want to make a minor tweak to my main player.

edit:
I’ve been playing around with it a bit more, and it seems like a other game objects are having the same problem. I don’t think this has to do with my ragdoll, even though that seems to be affected the worst. What could be going on???

Hi, welcome to the forum!

The deselection bug has been known about for some time, but the QA team haven’t been able to reproduce it yet, even with projects sent in by the affected users. It appears to be caused by something that goes wrong with the Unity installation itself. However, it wouldn’t do any harm to file a bug report (menu: Help > Report A Problem) and attach a project which shows this behaviour.

You understood what the T-pose was correctly. Can you describe what exactly went wrong with the joints? Did it happen with any particular joints and did they just hinge in the wrong directions or was there anything else wrong?

Thanks for the reply. Googling “unity deselection bug” actually brought up another post about how it had happened for another user after adding networking to their project, and though I never thought of it before, this is my situation as well. So it definitely has something to do with networking, I would say. Just like the other user, I integrated some sample scripts taken from a tutorial, so it’s quite possible that I haven’t completely figured out what everything does, and some portion of the example code doesn’t apply correctly to my project, and that’s somehow causing the bug.

As for the ragdoll problems, I think I figured out everything there. It had to do with the fact that I built a spine out of hinged joints, and then tried to use the ragdoll builder on top of that. I re-did the ragdoll (which obviously didn’t fix the bug) and got everything working correctly that time. Thanks for your help on that one.

the deselect bug comes from starting network in editor play mode and not close it before you end the play mode. it will then remain kind of active and pull away the focus after each action on keyboard / mouse basically.
solution to it is entering and leaving play mode again (assuming you don’t do the connection thing right on the first scene but that would be pretty uncommon as intro - menu are first)

edit: yeah, what he said :slight_smile: