+1
Fixed

Scripts disappear from game object toolbar after exiting play mode and reappears only in play mode

Youdaman 7 months ago updated by Lazlo Bonin (Lead Developer) 7 months ago 10 1 duplicate

This seems to be the same bug as these:
https://support.ludiq.io/communities/41/topics/4453-inspector-shows-script-but-object-tab-doesnt
https://support.ludiq.io/communities/41/topics/4325-puppetmaster-components-disappear

However both posts didn't provide repro and while I left a comment on the first post it makes more sense to create a new post so that it's not buried.

Peek version: 1.1.5

Unity versions tested: 2018.4.13f1, 2019.2.15f1, 2019.3.0f1

Steps to reproduce

0. create a fresh project in Unity and install Peek only.

1. add either an existing script or create a new script component to a game object.

2. editor thinks for a bit and then adds script icon to game object toolbar.

3. hit play -- you can still see the script icon in the game object toolbar.

4. stop play -- script icon disappears.

5. hit play again -- icon reappears.

6. hit stop again -- icon disappears.


So it looks like the icon is added to the toolbar after you add a script but disappears on exiting play mode.

Happens with a simple cube and a new behaviour script.

Also happens if you create an object that comes with scripts already attached, e.g. MapMagic -- it creates a new MapMagic object with a MapMagic script component, and the script icon that appears after creation disappears when you exit play mode.

Same result whether in maximised or standard layout. Same result whether script created by + icon on game object toolbar in the scene tab or via the add component button in the inspector tab.

Best guess is that the refresh that happens after first adding a script which makes the icon appear, and which also makes it appear during play mode, isn't being run again after play mode finishes.

Also noticed it hides the script icon(s) for the item in the inspector when not maximised. As above, icon is there to start with, then you hit play and it's still there, but you exit play and it disappears and then reappears only in play mode.

Unity Version:
2018.4.13f1, 2019.2.15f1, 2019.3.0f1
Peek Version:
1.1.5
GOOD, I'M SATISFIED
Satisfaction mark by Youdaman 7 months ago

Duplicates 1

Hi Manuel,

The status bar at the bottom shows a GUI exception.

Can you paste the log of that error and any other warning or error that might be related?

Hi Manuel,

Can you paste the code of that script so we can see if it has anything special that would cause it to be hidden?

We try to follow the same display conditions as the default Unity inspector but we might be more aggressive in hiding here for some reason.

I have this same issue, Unity 2018.4.13f1, Peek 1.1.5

Steps to reproduce:

1. add either an existing script or create a new script component to a game object.

2. editor thinks for a bit and then adds script icon to game object toolbar.

3. hit play -- you can still see the script icon in the game object toolbar.

4. stop play -- script icon disappears.

5. hit play again -- icon reappears.

6. hit stop again -- icon disappears.


So it looks like the icon is added to the toolbar after you add a script but disappears on play.

Happens with a simple cube and a new behaviour script.

Also happens if you create an object that comes with scripts already attached, e.g. MapMagic -- it creates a new MapMagic object with a MapMagic script component, and the script icon that appears after creation disappears when you exit play mode.

Tried it in 3 different versions of Unity with fresh projects and only Peek installed and got the same result:

2018.4.13f1

2019.2.15f1

2019.3.0f1

Same result whether in maximised or standard layout. Same result whether script created by + icon on game object toolbar in the scene tab or via the add component button in the inspector tab.

Best guess is that the refresh that happens after first adding a script which makes the icon appear, and which also makes it appear during play mode, isn't being run again after play mode finishes.

Also noticed it hides the script icon(s) for the item in the inspector when not maximised. As above, icon is there to start with, then you hit play and it's still there, but you exit play and it disappears and then reappears only in play mode.

+1
Escalated

Hi Youdaman,

Thanks for the reproduction steps, that sounds like a problem with our component caching layer. I'll have a look soon.

+1
Fixed (Unreleased)

Hi everyone,

Thanks for the reproduction steps, I was able to reproduce and fix the issue. Peek's component caching layer got confused because the script components get destroyed when you exit play mode, but the assemblies don't reload, so our caches were holding on to null references. I made sure all caches clear when exiting play mode in v.1.1.6, and it seems to work now.