[solved] How to implement invisible forcefield

I want to create an invisible force field (a barrier); so I created a kinematic RigidBodyControl.

The problem is that I need a Geometry to place it (and move it) on the game world. I’ve tried with replacing it with a invisible Node but it doesn’t work. Removing the Material doesn’t work either (maybe exist some invisible Material?)

Directly create a RigidBody, without a spatial at all.

1 Like

I’ve tried with this… no luck :frowning:

[java]
barrier_phy = new RigidBody(1.0f, new MotionState(){

        @Override
        public Transform getWorldTransform(Transform t) {
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }

        @Override
        public void setWorldTransform(Transform t) {
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
    },new SphereCollisionShape(40.4f));

[/java]

Go on level higher,

take a look at the examples, there should be some using rigidbodys.

Also no reason to implement the motionstate yourself, the defaults should be fine.
http://hub.jmonkeyengine.org/javadoc/com/jme3/bullet/objects/PhysicsRigidBody.html

1 Like

Thank you! :slight_smile: