Results 1 to 2 of 2

Thread: AssetBundle Walk Animation

  1. #1

    AssetBundle Walk Animation

    When one adds one of the TTS provided RPG figures, when the figure is picked up and moved, it automatically activates the walk animation.

    I have created my own assetbundle characters using a hybrid of instructions. I found one document that is for the latest version of TTS/Unity but it does not detail specifics for characters (it is just for general assets). I found another document which was for a previous version of TTS/Unity which details what Unity properties need to be set for a character asset but some of the settings are a little different in the latest Unity. In any case, I got it all working and I can animate various actions such as Idle, Ready, Attack and Die.

    My question is: In order to automatically trigger the walking animation when a token is being move, do I need to script that manually or should that somehow get automatically triggered based on the TTSAssetBundleEffects.cs script that is added to the character in Unity?

  2. #2
    It looks like the walk is not animated out-of-the-box but it is trivial to add a Global level script to do this...

    Code:
    function onObjectPickUp(color, obj)
      if obj.AssetBundle!=nil then
        obj.AssetBundle.playLoopingEffect(3)
      end
    end
    
    function onObjectDrop(color, obj)
      if obj.AssetBundle!=nil then
        obj.AssetBundle.playLoopingEffect(0)
      end
    end
    The above script assumes that the walk animation for each character is the 4th LoopingEffect (the value is 3 because TTS starts numbering from 0) and the idle (non-walking) animation for each character is the 1st LoopingEffect.
    The script does a check to see that a AssetBundle exists to avoid generating an error for non asset objects (like props). It seems that if a object has an AssetBundle but not the corresponding LoopingEffect then no error is generated.
    For example, if a object only has 2 LoopingEffects then requesting index 3 does not cause an error.

    Obviously if the game has AssetBundles for other stuff besides characters, the script would need to be modified to ensure that it trips only for characters.
    Last edited by LordAshes; 08-04-2019 at 09:02 AM. Reason: Added support information

Similar Threads

  1. AssetBundle: Playing a Sound at a specific frame of animation
    By Luthervian in forum General Discussion
    Replies: 3
    Last Post: 10-24-2017, 09:25 AM
  2. Animation for bag shuffle
    By Unreal_Ed in forum Suggestions
    Replies: 6
    Last Post: 06-26-2017, 09:38 AM
  3. Accessing AssetBundle Animation Component
    By Velian in forum Scripting
    Replies: 2
    Last Post: 04-22-2017, 12:46 PM
  4. Asset Bundle Animation
    By RiceKun in forum General Discussion
    Replies: 8
    Last Post: 02-01-2017, 01:24 AM
  5. Replies: 10
    Last Post: 10-30-2016, 05:56 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •