I have a class with following parameters:
extends BulletAppState implements PhysicsTickListener
in this class method prePhysicsTick I read input keys and apply player movement/rotation.
So far that works.
Now I work on showing to user selected object on mouse over.
This is done by adding/removing ambient light for selected object.
If I add this code inside of method prePhysicsTick or PhysicsTick, I get error:
Uncaught exception thrown in Thread[jME3 Main,5,main]
IllegalStateException: Scene graph is not properly updated for rendering.
State was changed after rootNode.updateGeometricState() call.
Make sure you do not modify the scene from another thread!
Problem spatial name: Root Node
If I implement code in public void update(float tpf),
then Physics tick is not executed anymore.
What could you advise, what am I doing wrong?