Hello once again I have run into an issue with Zay-ES.
My issues is with the player position. So I am using BulletPhysics and my PhysicsAppState implements PhysicsTickListener. And is Added to a physicsState. So I applyChanges at prePhysicsTick. Then set new Position/rotationComponents based on Rigidbodies tied to the entityIds after physics has run in the physicsTick.
This works great for the most part. Except when it comes to moving the character around. I want to be able to override the Position/Rotation/Velocity components from the CharacterControlAppState. However, I have obviously overlooked something and can’t figure the proper way to achieve this.
Yes physics objects are fine. The problem is the player entity. When I change it’s velocity I need it to override the velocity on the rigidbody in the PhysicsState. I think that I got it. I think I have to attach the Physics and Visual state last. But my problem now is the I keep getting NPE when I have my VisualState and PhysicsState attached after everything else.
The EntitySets in PhysicsState are not triggering applyChanges() when I have it attached after the other states. So I can’t add the entities to the PhysicsState and it throws NPE…
So, going out on a limb without seeing any code… I hate randomly guessing about stuff… but whatever.
Probably when you create your entity set you need to call addFooBars(entitySet) or whatever. And your addFooBars() method should be taking Set… and is the same method you call in your applyChanges() block.
Steps to use:
-subclass it to add your own add/update/remove functionality
-instantiate your subclass
-call start() when you want to start pulling entities
-call update() once a frame
-call stop() when done.