Topic: Determination of the direction of movement (fighter 3d mode)

How to determine the direction of movement for the fighter 3d mode? I want to add separate animations for diagonal movements, but as I understand it, MoveX and MoveZ are performed separately. How can I determine the diagonal direction within the UFE?

Share

Thumbs up Thumbs down

Re: Determination of the direction of movement (fighter 3d mode)

There is no direct way to add animations to move sideways, but you could look into the following code segments:
Physics.MoveZ (line 91):

        if (UFE.config.inputOptions.forceDigitalInput) axisValue = axisValue < 0 ? -1 : 1;

        controlScript.currentSubState = SubStates.MovingSideways;

Physics.ApplyForces (line 804):

                else if (controlScript.currentSubState == SubStates.MovingSideways) {
                    if (moveSetScript.basicMoves.moveSideways.animMap[0].clip == null)
                        Debug.LogError("Move Sidewyas animation not found! Make sure you have it set on Character -> Basic Moves -> Move Sideways");
                    if (!moveSetScript.IsAnimationPlaying(moveSetScript.basicMoves.moveSideways.name))
                    {
                        moveSetScript.PlayBasicMove(moveSetScript.basicMoves.moveSideways);
                    }
                }

You will essentially need to record the axisValue state and use it to change the moveSideways animation to a different animation slot located under the BasicMoveInfo instance.

I'll look into adding this extra animation slot in the future.

Like UFE? Please rate and review us on the Asset Store!
Questions about the Forum? Check out our Karma FAQ.
Don't forget to check our discord channel.