How to freeze Ultimate Character Controller character?

kentreva

Member
How would I freeze the opsive character in whatever animation it's currently in, and then resume later, via script or some other built in functionality if any.

The Converse ability as shown in the docs is able to Disable Gameplay Input and can untick Allow Positional Input and Allow Rotation Input to prevent any player input from moving the character. That's good, but how would I freeze the opsive character in whatever animation state it currently is in? Is there a built in way to do this easily. I do not want to quit any active ability (i.e: Use/Attack); the freeze should be temporary and resume whatever abilities and animations that were playing before the initial freeze happened.

Here's an example scenario:
  1. UCC character is in the middle of some ability/animation. They could be in the air. Let's assume a jump ability.
  2. Freeze is triggered when the character is at the peak of their jump.
  3. Character is frozen (animation freezes. stays floating in air). No input is allowed.
  4. Freeze is disabled.
  5. Character resumes any ability/animation that happened before the freeze. i.e; jump continues and player falls.
 
I did this by changing the timescale of the locomotion to 0, as shown here.

1654482799973.png
BUT, it seems like any ability that was running during the freeze, continues to run, it's just not visually running. I tested this with a script that triggers the abilities of the character automatically, and while the timescale is 0, i'm still hearing new ability start sounds, meaning abilities are being triggered and running while timescale is 0 while the character doesn't look like its moving. When the locomotion timescale is reverted to 1, the character immediately starts from the middle of an ability's animation (i'm assuming this is because it reverted in the middle of a triggered ability that started after locomotion.timeScale = 0)

1. Shouldn't timescale = 0 disable all the abilities from running?
2. If not, what does this timescale really do? Is it just on the animator?
3. What is the easiest way to just pause everything on the Ultimate Character Locomotion script, including all abilities, and then resume continuation of the character whatever it was doing (i.e middle of jump animation). I just don't want the character to move and not progress any ability/animation that was interrupted by the freeze, as explained in the first post.
 
Glad you are making progress. Setting the character's time scale to 0 is correct.

1. Shouldn't timescale = 0 disable all the abilities from running?
No, abilities can still start/stop even when the timescale is 0. It's not disabling any code from executing.

2. If not, what does this timescale really do? Is it just on the animator?
It stops the animator and any movement. It doesn't prevent code from being executed. This is similar to the global timescale.

3. What is the easiest way to just pause everything on the Ultimate Character Locomotion script, including all abilities, and then resume continuation of the character whatever it was doing (i.e middle of jump animation). I just don't want the character to move and not progress any ability/animation that was interrupted by the freeze, as explained in the first post.
This specific scenario hasn't come up before. You will need to set the timescale to 0, but then also create a new script which disables all inputs. You could do this by disabling the handler components.
 
Top