Hello!
I’ve been having issues with RootMotionSources. The documentation leaves some to be desired, and I’m not sure if I’m using it right.
To clarify, I’m making a multiplayer game with very fast movement, dodges, knockbacks, walljumps and so on. I’m using RootMotionSources for them.
I have a knockback motion, which moves the character backwards ( or on an arc, depends on the settings ). If it hits a wall, it should play a special animation where the character gets pinned to the wall, if it doesnt, it should move for a minimum amount of time, then start checking for floor, and when there is floor below the character, motion stops, and play another special animation (fall down and get up).
At first I made it by putting a delegate into the root motion, and call it when i found wall/floor, then calls Status.SetFlag( ERootMotionSourceStatusFlags::Finished );
the character binds for the delegate, and handles the animations, and so.
However I found out that this RootMotionSource gets copied left and right, created/destroyed, rollbacked, reapplied, etc, so I thought it’s not so great idea to call a delegate inside. After checking how the GAS uses it, I found out that it simply checks in Tick if the root motion is still valid and not in finished state.
However, the new situation is that sometimes the root motion gets deleted before i could catch the outcome of it. So checking in tick doesn’t look so good.
I’m not sure what’s the proper way to handle this situation.
Also a second question, how should one apply a root motion? I’m applying it on controlling client and on authority. It works fine if the client if the initiator, but if the server is initiating (e.g. knockback - damage and any other effects are handled by server ), then if the client is lagging a bit (Net PktLag=100), it jumps horribly around. Even with the built in root motions (tried with RootMotion_ConstantForce).
I’m using 4.23, but tried with 4.25 and it had the same problem