Spatial collision gives error :/

Hello!

I was looking for an spatial collision example but didnt seem to find it.

So I create my own code:

 CollisionResults cr = new CollisionResults();
        List<Spatial> a = rootNode.getChildren();
        Spatial child = physicsCharacter.getChild(0);
        System.out.println(child.getName());
        for (int i = 0;i<a.size();i++){
            child.collideWith(a.get(i), cr);
             System.out.println(cr.size());
        }



Now, This doesnt work :/
It gives me the UnsupportedCollisionException

Am I doing something wrong?
I got the spatial mesh out of both the physicscharacter and the children of rootnode..

Only rays and objects can collide atm. You could use physicsnodes and ghostnodes for collision checks of complete objects.

PhysicsCharacter is not included right?

Because right now, it doesnt show anything when im inside the ghostbox

Addez said:

PhysicsCharacter is not included right?
Because right now, it doesnt show anything when im inside the ghostbox

No, its a ghostnode itself.

Ahh!

So Ghostnode can only collide with physics and other ghostnodes.

Gots it :slight_smile:



But then, I got a problem…

I got a physicnode inside a ghost node, and it doesnt react…