SceneComposer: Add Control.. problems

I like to add a custom Control to a geometry spatial inside the scene. But when I click on “Add Control…” the list does not contain all classes that are implementing com.jme3.scene.control.Control. Furthemore, when I enter the FQN of my custom Control class into the textbox below then following occurs:
Error in scene! (java.lang.NullPointerException)

Are there any restrictions when adding controls to a spatial? BTW, where can I see which controls have already been added?

So your control probably causes a NPE when added, check the error output.

I don’t think so, it is the most simple listener one can think of…
[java]
public class PuttGhostControl extends GhostControl implements PhysicsCollisionListener {

public PuttGhostControl(CollisionShape collisionShape) {
    super(collisionShape);
}

public void collision(PhysicsCollisionEvent event) {
    System.out.println("Collision detected!");
}

}
[/java]

Without an empty constructor you cannot add a control like this at all. Who’s supposed to set the constructor? :slight_smile:

It actually had a default constructor without parameters at the time the NPE happened.

I already changed the strategy by getting the child node of the scene by name and add the control manually.

So the NPE still is a problem. But I found a workaround.