NPCAnimate Module Instruction Manual
Overview:
The NPCAnimate module allows for simple animation control of NPCs in your game. Designed to animate both moving and non-moving NPCs, this module provides essential functions to load, play, and manage animations. It also includes movement detection to automatically switch between idle and walking animations.
Features:
- Create and Initialize NPC Animation: Instantiate the module and start with a default idle animation.
- Load Animations: Easily load and assign animations to NPCs.
- Play and Stop Animations: Control which animation is playing and stop all animations when needed.
- Movement Monitoring: Automatically switches between idle and walking animations based on NPC movement.
Instructions:
-
Setup:
Ensure your NPC model includes aHumanoid
andHumanoidRootPart
. -
Creating an Instance:
local NPCAnimate = require(game.ServerScriptService.NPCAnimate) local npc = game.Workspace.NPC -- Replace with your NPC model local npcAnimator = NPCAnimate.New(npc)
-
Loading Animations:
Load animations by specifying a name and asset ID. Example:npcAnimator:LoadAnimation("Idle", "rbxassetid://18789682643") npcAnimator:LoadAnimation("Walk", "rbxassetid://18889146679")
-
Playing an Animation:
To play an animation:npcAnimator:PlayAnimation("Idle")
-
Stopping an Animation:
To stop a specific animation:npcAnimator:StopAnimation("Walk")
-
Stopping All Animations:
To stop all animations:npcAnimator:StopAllAnimations()
-
Checking Current Animation:
Retrieve the name of the currently playing animation:local currentAnim = npcAnimator:GetCurrentAnimation()
-
Movement Monitoring:
The module automatically switches between idle and walking animations based on the NPC’s movement.
Notes:
- Ensure that the NPC model has a
HumanoidRootPart
andHumanoid
. - Animations are looped by default; adjust as needed.
Elevate your NPC interactions with the NPCAnimate module! This versatile tool brings your NPCs to life by seamlessly animating them based on their movement. Whether your NPC is idle or on the move, this module ensures smooth transitions and engaging animations. With easy-to-use functions for loading, playing, and managing animations, you can quickly enhance the visual appeal of your game. Try NPCAnimate today and add dynamic character animation to your Roblox experience!
Also please remember that this tool will work as soon as you make a new NPC instance as shown in part 2 of the instructions.
Get the module at this link: NPC Animate - Creator Store (roblox.com)