Looped TransferUp when teleporting

Cheo

Active member
Hello, the Hang ability is not properly stopped when using SetPositionAndRotation with stopAllAbilities and snapAnimator set to true while TransferUp is playing. Here's a video to illustrate the issue :


Here's also the simple code I used :

C#:
using Opsive.UltimateCharacterController.Character;
using UnityEngine;

public class TeleportTest : MonoBehaviour
{
    public KeyCode TeleportInput;
    public UltimateCharacterLocomotion UCC;
    public Transform Target;

    private void Update()
    {
        if (Input.GetKeyDown(TeleportInput))
        {
            UCC.SetPositionAndRotation(Target.position, Target.rotation, true, true);
        }
    }
}

I wanted to to be able to stop the ability and teleport the character at the same time as I have an issue in my project where the player can end up in an infinite transfer up state when climbing to an upper ledge, which may be caused by yet another issue, I'll likely make an another post about that in the near future. In any case while this may look like an edge case we should be able to use SetPositionAndRotation to teleport the character and stop his abilities instantaneously at any time.

Lastly since this is almost Christmas this can naturally wait a bit ! Merry Christmas to everyone :)
 
Merry Christmas! This is likely related to the Animator Controller not having an exit transition when in the transfer up/down animations. It normally goes through the dismount animation first. The fix would be to add a transition when the hang ability index is no longer active.
 
Nope, there already is a transition going from TransferUp to Exit, see the attached screenshot. The issue has to be something deeper than that, please try reproducing it when you have the time.
 

Attachments

  • TransferUp - Exit.png
    TransferUp - Exit.png
    239.8 KB · Views: 2
@Justin Hello, I have a new playtest event planned this Wednesday and need the teleportation to be working as a failsafe. Would it be possible to look at this by Tuesday ? Thanks.
 
I started to look into this but it looks like it is going to take some core controller changes in order to fully fix. You can start by returning the force parameter to Hang.CanStopAbility. If you have MoveWithObject deselected on the ability then your teleport will work. I need to release a Behavior Designer update and then will be able to take a look at the case where MoveWithObject is true.

Code:
        public override bool CanStopAbility(bool force)
        {
            return force || m_HangState == HangState.Shimmy || m_HangState == HangState.None;
        }
 
This works, thanks ! At the moment all ledges and ladders in my game are static, moving ones aren't meant to be implemented soon, so it's okay with me if you need time to create a fix for that scenario.
 
Back
Top