Adventure Creator Wikia
Explore
Main Page
Discuss
All Pages
Community
Interactive Maps
Recent Blog Posts
Popular pages
Most visited articles
Custom Action - Variable: MultiBoolCheck
General
Scrolling text and Scrolling text audio.
Cancel Interaction Menus
Adding image effects
Custom trigger (triggers one actionlist when entering and another when exiting)
Randomize speech audio (Random Syllables)
Use items on an AC Character
Running Animations when game is paused
Integrations
CNControls Integration (Virtual Joystick)
Rewired integration
Unity analytics Integration (AC Action)
FinalIK Interactions Integration (AC Action)
Rogo Lipsync (No audio) 01 - Play Action
Rogo Lipsync (No audio) 02 - Stop Action
Rogo Lipsync (No audio) 03 - Set Emotion Action
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
Adventure Creator Wikia
192
pages
Explore
Main Page
Discuss
All Pages
Community
Interactive Maps
Recent Blog Posts
Popular pages
Most visited articles
Custom Action - Variable: MultiBoolCheck
General
Scrolling text and Scrolling text audio.
Cancel Interaction Menus
Adding image effects
Custom trigger (triggers one actionlist when entering and another when exiting)
Randomize speech audio (Random Syllables)
Use items on an AC Character
Running Animations when game is paused
Integrations
CNControls Integration (Virtual Joystick)
Rewired integration
Unity analytics Integration (AC Action)
FinalIK Interactions Integration (AC Action)
Rogo Lipsync (No audio) 01 - Play Action
Rogo Lipsync (No audio) 02 - Stop Action
Rogo Lipsync (No audio) 03 - Set Emotion Action
Editing
Spine and Adventure Creator
Back to page
Edit
Edit source
View history
Talk (0)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Spine with Adventure Creator == Sources: http://esotericsoftware.com/spine-unity, https://www.youtube.com/watch?time_continue=137&v=8YssVJZ18V8 === 1. Install spine-unity === To use the spine-unity runtime in your Unity project: # Download the latest spine-unity unitypackage. Alternatively you can get the latest changes via Git as described below. # Import the unitypackage (you can double-click on it and Unity will open it). # Enabling Compatibility with 2D Toolkit: spine-unity supports 2D Toolkit and can render Spine skeletons using TK2D's texture atlas system. To enable 2D Toolkit compatibility, open Unity's Preferences via Edit -> Preferences... and in section Spine select Define TK2D - Enable. === 2. Export the animations === The following will export all animations as one object. We handle it later in Unity. Exporting in binary format instead of JSON will result in smaller file size and faster loading. # Choose Binary on the upper-left of the Export window instead of JSON. # Set the Extension to .skel.bytes. === 3. Importing the animations to Unity === Simply drag the generated files into the assets folder. For example Characters/<CharacterName> Then drag the _SkeletonData asset into the Scene view or the Hierarchy panel and choose SkeletonAnimation. A new GameObject will be instantiated, with the required Spine components already set up. === 4. Creating a character === Take the GameObject from the last step and run the Adventure Creator Character Wizard.Β NOTE: Make sure to select Sprites Unity as the Animation Engine. Once the Character is set up, rename it to the Character name and drag it into the assets folder to create a prefab of your new player. For example Characters/<CharacterName> === 5. Setting up the animations === Next up is creating a PlayerController and and mapping all the animations to the direction and state of the player. # Open the player prefab and change the Player component to animate in 8 directions. # Add an animator component to the prefab child skeleton. The GameObject from the previous step. # Create a PlayerController for the animator compontent. Open the PlayerController in the Animator window and create states for all the expected anmations. ==== 5.1 Custom scripting ==== To get everything to work you need to add a custom script. The script will allow us to override the basic animation with the skeleton animations that we made in Spine. We also add a variable speed to be able to adjust the speed of the animation. Create a news script the assets folder. I chose to call it SpineAnimationScript.cs. Open visual studio and paste the following: using UnityEngine; using System.Collections; using Spine.Unity; public class SpineAnimationScript : StateMachineBehaviour { public string animationName; public float speed; public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { SkeletonAnimation anim = animator.GetComponent<SkeletonAnimation>(); anim.state.SetAnimation(0, animationName, true).TimeScale = speed; } } <br> Attach this script to all of the states. Edit the variable animationName and speed to play the correct animation on different states. NOTE: The animation name directly maps to what animation names are available in the skeleton component. That's all! [[Category:Integrations]]
Summary:
Please note that all contributions to the Adventure Creator Wikia are considered to be released under the CC-BY-SA
Cancel
Editing help
(opens in new window)
Follow on IG
TikTok
Join Fan Lab