Hello everyone,
For my game, I created physical controller that can simulate moving platform, ascencor or object that turns on themselves.
I programmed my CustomCharacterControl class, I had problems with BetterCharacterControl, my characters were jumping all the time
When my character goes on a mobile platform, the velocity of the platform is not applied by default to my character,
To do this, during a captured collision, I add the velocity of my platform to moving my character via the setLinearVelocity method, so it moves along with the platform.
That works well.
@Override
public void collision(PhysicsCollisionEvent event) { if(event.getObjectA() == customCharacterControl){ if(event.getObjectB() instanceof CustomBody){ customCharacterControl.setFrictionTranform(((CustomBody) event.getObjectB()).getFrictionTranform().clone()); } else customCharacterControl.setFrictionTranform(Transform.IDENTITY); } if(event.getObjectB() == customCharacterControl){ if(event.getObjectA() instanceof CustomBody){ customCharacterControl.setFrictionTranform(((CustomBody) event.getObjectA()).getFrictionTranform().clone()); } else customCharacterControl.setFrictionTranform(Transform.IDENTITY); } }
I would now like to be able to apply the same principle when the character rides on an object that turns on itself.
I thought, initially, pass the rotation of the platform and apply it to my character but it does not work.
I also thought, at the time of contact, attached a node to the platform. the transformations of the platform will therefore be applied to the child node.
But how to then apply the transformations of the node to RigidBodyControl ? and most importantly, if I put my Custom RigidBodyControl in Kinematic, it will no longer be influenced by physics.
What do you recommend to me as a solution ?
Here is a small video of the problem:
Thanks