Don't add child components 'Game object' in objects of collection (SOLVED)

Error log

Error occurred while adding component

java.lang.ClassCastException: com.dynamo.cr.go.core.GameObjectNode cannot be cast to com.dynamo.cr.go.core.ComponentTypeNode… & more

Can you restart the editor and see if you can reproduce the error. If it still happens, can you write down the steps so we can try to make the error happen at our end?

Cheers!

I did not do anything special: just http://www.defold.com/tutorials/getting-started
"COMPLETING THE CAR
Continue by adding two more game objects in the collection. Call them “left_wheel” and “right_wheel” and put a sprite component in each, showing the tire image that we added to “sprited.atlas”. "

P.S. Editor’s restart has not changed anything.

Update Java: without result


java.version=1.8.0_05
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=ru_RU

Defold is shipped with java. Make sure that you have a complete install. All files and directories in the downloaded zip should live in the same directory (/Applications/Defold for instance)

logs

First: Unhandled event loop exception

java.lang.UnsupportedOperationException: Component type go not registered.
	at com.dynamo.cr.go.core.GameObjectPresenter.onAddComponent(GameObjectPresenter.java:59)
	at com.dynamo.cr.go.ui.handlers.AddComponentHandler.execute(AddComponentHandler.java:21)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
	at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
	at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4136)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1271)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3982)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3621)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at com.dynamo.cr.editor.Application.start(Application.java:42)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

Second: Error occurred while adding component

java.lang.ClassCastException: com.dynamo.cr.go.core.GameObjectNode cannot be cast to com.dynamo.cr.go.core.ComponentTypeNode
	at com.dynamo.cr.go.core.GameObjectPresenter.onAddComponent(GameObjectPresenter.java:51)
	at com.dynamo.cr.go.ui.handlers.AddComponentHandler.execute(AddComponentHandler.java:21)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
	at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
	at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4136)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1271)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3982)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3621)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at com.dynamo.cr.editor.Application.start(Application.java:42)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

Can you explain exactly what you are doing, step by step. What did you click / drag in what order?

Step by step.

  1. Creat a new project “Test” on the Defold Dashboard
  2. File > Open Project > Test
  3. Creat a new branch “Main”
  4. Clean “main.collection” of the one game object it contains. Select “go” in the Outline view, right-click and select Delete
  5. Create a new collection “car.collection”. Select File > New > Collection File from the main menu.
  6. Add game object. Select the root “Collection” node in the Outline view, right-click and select Add Game Object.
  7. Rename new game object to “car” from “go”
  8. Add “sprite” to game object “car”. Select the “car” game object, right-click and select Add Component, then select Sprite and click Ok
  9. Create new atlas file “sprites.atlas”. In the Project Explorer view, right-clicking and selecting New > Atlas File.
  10. Add images. Drag them into “main” in the Project Explorer view.
  11. Add images to sprites.atlas. Right click and select Add Images. Select two images and click OK&
  12. Select “sprites.atlas” for “car.collection” as the image source for the sprite component in the “car” game object in the “car” collection.
  13. I tried to add two more game objects in the collection. And got two errors:

Error log:

Unhandled event loop exception. java.lang.UnsupportedOperationException: Component type go not registered.
Error occurred while adding component. java.lang.ClassCastException: com.dynamo.cr.go.core.GameObjectNode cannot be cast to com.dynamo.cr.go.core.ComponentTypeNode

All other components are added to car.collection without errors.

Incidentally, in the Debian bug is the same: you can not create a child object. What am i doing wrong?

Can you explain in detail step 13, how you add the game objects? Ideally if you could record a video. We are trying to replicate this problem with no luck.

Right click object “car” -> Select “Add Component” ( I ) -> Select “Game object” -> Click “ОК”

log 1: null
Error
Fri Oct 30 15:29:34 NOVT 2015
Error occurred while adding component
java.lang.ClassCastException: com.dynamo.cr.go.core.GameObjectNode cannot be cast to com.dynamo.cr.go.core.ComponentTypeNode … (more)
log 2: null
Error
Fri Oct 30 15:27:34 NOVT 2015
Unhandled event loop exception
java.lang.NullPointerException … (more)

video bug Add object

Ok, that is definitely a bug! Thanks for spotting!

The “Game Object” should not show up in the components list so ignore that until we’ve fixed that. Add game objects side by side in the collection and drag them onto each other to create parent-child hierarchies.

DEF-1543

1 Like