Facepunch / sbox-issues

180 stars 12 forks source link

Changing class inheritance on components prevents component from attaching to GameObject #7484

Open ddkeating opened 1 week ago

ddkeating commented 1 week ago

Describe the bug

Whenever I create a component on a gameobject and change the class it inherits from, the component will no longer attach to the gameobject until reload. This is the case for components that inherit from classes that also inherit from the component class.

Image

Image

To Reproduce

  1. Select any gameobject and create a new component
  2. Open code editor and change class inheritance from component to whatever class you have setup
  3. Watch the component disappear from inspector and cannot be reattached to gameobject until reload.

Expected behavior

Component should stay attached to the gameobject and allow you to reattach without reloading the scene.

Media/Files

No response

Additional context

No response