Conflict between Velocity in eMotion and game logic Velocity

Hi All:

I tried to use EmotionX, I found a problem about physics. In ActorComponent::OnTick

Entity requests update Velocity every frame. If I want to SetVelocity in my game logic, what should I do?

eg: If I want to Jump or fall from the mountain, How can I control the Velocity?

Looking forward for your reply, thank you

@Amonster_LMBR @Castor

Hi @Castor @Amonster_LMBR, can you look into this issue, please? :slight_smile: It has been a week. thank you

Hey @MibuWolf, much apologies for the delays in responses — I’ve poked at the team to get some assistance on this topic :slight_smile: Stay tuned!

Thank you ,look forward to your reply again.

Hey @MibuWolf,

Sorry you are correct, that is the Mannequin one. The EMFX one is in the same location but called MovementControllerEFX.lua. We recently updated StarterGame to use EMFX, so make sure you’re using 1.15 so your Jack player slice should look like this:

Hey @MibuWolf

Have you looked at this docs page yet regarding CryCharacterPhysicsRequestBus.Event.RequestVelocity ?

https://docs.aws.amazon.com/lumberyard/latest/userguide/component-physics-character.html#component-physchar-ebusrequest-3

This should help you layer the velocity of a jump/fall with your movement. StarterGame should also have an example under the Scripts/Jack/ directory in the MovementController.lua script too.


Thank you for your reply. I know RequestVelocity. But,my problem is RequestVelocity called by ActorComponent per frame, This causes the logic call RequestVelocity(or SetVelocity) to conflict with ActorComponent. And All the question based on emotionfx.
StarterGame example under the Scripts/Jack/ directory in the MovementController.lua scrip is based on Mannequin.
Do you have a good solution based on Emotionfx to solve this problem? Thank you again and look forward to your reply again.

Hey @MibuWolf,

You are correct. At this moment, you do have to manually update the logic yourself, which you have discovered already.

The current CryPhysics system does not actually work with the EMFX animation system because the focus has been more on getting PhysX up and running, which is why you’re likely running into issues when using anything during the OnTick call.

Apologies for all the back and forth on this. I realize that was the simplest answer to your question.

thank you for your reply. I have already seen MovementControllerEFX.lua But I still have a problem. In MovementControllerEFX.lua The speed in the horizontal direction depends on the emotionfx itself, and the speed on the z-axis requires the logic layer to adjust each frame to offset the influence of the Z-axis in the emotionfx.

Can I understand that the movement of the x y axis can be controlled by the action itself, the movement of the z axis requires logic to update the control speed per frame, and can not use the gravity acceleration of the physics engine?

Thank you again and look forward to your reply again.

Thank you for your all responses, Now I konw what should I do , Thank you angain for you answer