Time.timeScale
using GamingIsLove.Makinom;
using Unity.VisualScripting;
using GamingIsLove.Makinom.Schematics;
using GamingIsLove.Makinom.Schematics.Nodes;
using UnityEngine;
namespace _GAME._CUSTOM_ASSETS.ORK.Nodes
{
// The 'EditorHelp' attribute manages the name and description of the node.
[EditorHelp("HitStop Effect", "This node causes a hitstop effect for a specified duration.", "")]
// The 'NodeInfo' attribute manages in which section the node can be found in the add node selection.
[NodeInfo("Combat/Hit Effects")]
public class HitstopNode : BaseSchematicNode
{
// Declare node properties
[Tooltip("The duration of the hitstop effect in seconds.")]
public float Duration;
[Tooltip("The timescale to set after the hitstop effect ends.")]
public float TimeScale;
public HitstopNode()
{
Duration = 0.05f;
TimeScale = 1f;
}
// Execute node
public override void Execute(Schematic schematic)
{
// Pause game
Time.timeScale = 0f;
// Wait for duration
float pauseEndTime = Time.realtimeSinceStartup + Duration;
while (Time.realtimeSinceStartup < pauseEndTime)
{
schematic.Yield();
}
// Unpause game
Time.timeScale = TimeScale;
// Tell schematic what to do next
schematic.NodeFinished(this.next);
}
// Node details
public override string GetNodeDetails()
{
return "This node causes a hitstop effect for a specified duration.";
}
// Node color
public override Color EditorColor
{
get { return Color.red; }
}
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!
This will pause your animations while everything else continues to run at their normal time rate. The first SF example likely uses separate animations for the hair itself, and/or runtime deformation like is done with cloth, and this solution would still allow those to keep moving as well. Granted that's just a guess because of the clipping through the body which happens more often with these two methods than if the hair was animated with the movement.
As @Acissathar said, setting animator speeds is a way to only slow/halt animations instead of everything.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!