Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

TowerDefense ToolKit 4

Discussion in 'Assets and Asset Store' started by songtan, Apr 18, 2012.

  1. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    When setting up ShootObject, there is 2 sound clips that i can attach on them.
    I would love to be able to use my own Audio Groups for them.
    Would it be possible for you to attach a field for audio groups? cause rest of my game is really regulated but shoot sound are really loud :D hehe

    Thanks for fast support last time!
     
  2. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,638
    Just so we are clear, you want the tower to apply a debuff to the creep which will modify the chances of the creep getting critical hit when attacked? What you described sound about right to me. And yes it's suppose to work this way. What I would check is what is the effect type you set the effect as? Multiplier or modifier. Multiplier effect multiplies (x) the base value of the target. Modifier modify (+) the base value of the target. So if you are using multiplier, your creep will need to have a base critical reduc. value to start with. Otherwise you get zero multiply by the effect value, which still ends up as zero.
     
  3. YevgenG

    YevgenG

    Joined:
    Oct 17, 2018
    Posts:
    10
    Yes, you got me right! And, I suppose, Critcal Reduc. should be negative value, as if it will be positive with some multiplier, it will increase a potential of a creep to resist critical damages :) For example, Tower effect ability will have -1 Modifier, in this case all critical attacks on affected creep should pass?
     
  4. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,638
    I should point out that both Crit Chance and Crit Reduce takes value from 0 to 1, with 0 as 0% and 1 as 100%. The way Critical Reduc work is it directly negate the incoming attack's Crit Chance. Say the attacker Crit Chance is 0.5, then it has the base critical chance of 50%. Now if the target has a Critcal Reduc of 0.3. The chance of a critical hit becomes 20% (0.5-0.3=0.2). Note that the Critcal Reduc will never exceed the value of 0-1. So if you effect has a Critcal Reduc modifier of -1, the target will effectively has 0 Critical Reduc (0.3-1=-0.3). On the other hand if the effect has a Critcal Reduc modifier of 1, the target will effectively has 1 Critical Reduc (0.3+1=1.3). Making it immune to critical hit in an attack.
     
  5. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    Could you help with AudioMixer? For all the sounds in AudioManager?
     
  6. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    I have a issue.

    when i start first demo map.
    There are 2 path units Can run, if i Block first path they Will run second path.

    if i Then sell the Tower that are blocking and Block last node in second path. they Will turn around and run the first path again.

    i Can Then continue This over and over again.
    This is HUGE bug. It literali breaks the game.

    is there a fix i dont know about @songtan ??
     
  7. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,638
    I'm afraid I can't help you with regards to the audio. I'm not an expert on that end by any mean and I'm not familiar with AudioMixer at all.

    By first demo map are you referring to Demo_BranchingPath? So the problem is the player can keep on switching the path they block and force the creep to go back and forth between the two path? I don't think that's a bug. I mean that is an inherent exploit that the player can use if you allow mazing in your level.
     
  8. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    I have made a fix for AudioManager you Can implement in your next version. That Will assign all audiosources to a specific audio mixer. And the building sounds to a custom audio mixer. So you Can change and regulate the different sounds :) I Will send tomorrow.

    Regarding the AI, if and Unit is moving in One path. And you Block that path. It should not return back to path 1 again. Like where it started out. That means anyone Can kill any boss or wave. Just keep blocking. Then all minions run back and forth.

    the whole idea of and Tower defence is to protect against minions reaching your Goal and losing life.

    is there a Way i Can make it so that if minions are inside lets say the build square that if they are there they WONT return back. But rest Will?

    in my mind they should not be able to Block a path if there was only One path and minions choose that. Then the minions should not turn around and Walk a different path.

    Another solution would be to make all minions that are on path that are now blocked. Be attacking minions instead so they Will destroy the players Towers instead. That would be a great twist haha
     
  9. jendrikb

    jendrikb

    Joined:
    Sep 22, 2017
    Posts:
    12
    Hi Songtan!
    I´ve started to work with TDTK today -- amazing asset so far, everything very smooth and logical. Easy to extend and work with. Thank you so much for this one!

    Of course I also have a problem: My creeps are moving on the path as long as I dont use your animation controller. Because I need animations, I´m using it. Animation is being played but then the creeps aren´t moving. Any hint where I should have a look?

    Thank :)
     
    Niroan likes this.
  10. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    hey buddy

    please check the animator on the unit. You need to use hes special animator and Then the avatar of the model. The apply the animation via tools and td controller for units all at the bottom :) hope it helps
     
  11. jendrikb

    jendrikb

    Joined:
    Sep 22, 2017
    Posts:
    12
    @Niroan thanks! Actually I´m doing this. Animation iis being played, but the movement on the path is not working. If I use the creep without animator, it is moving on the path. Still strange...
     
  12. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,638
    @Niroan, I don't think there's a way to solve your problem. Even if you limit the path reroute to a single platform, you will still end up with the same problem. Let's say you have a very small 5x5 grid, like this:

    TDTK_MazingExploit.png

    There's still no stopping player from building and selling and point-A and point-B to keep the creeps go back and forth. You can only solve this by tweaking your game rules. Like a cost penalty for selling so everything you do this you lost some resources. Or only allow building between waves. Or keeping the mazing area small enough that such exploit are not feasible

    Beside, The whole point of mazing is that the creep actively re-path according to where the player places a tower. They will choose another route if the route they are going for is blocked. Taking that away, you might as well just use a linear path.


    @jendrikb, It's hard to say what's wrong without actually seeing what happen. Maybe you have a video or you can send me your prefab? But the first thing I would check is the 'apply root motion' option on your animator. With that on, the animation could mess up the creep movement.
     
  13. jendrikb

    jendrikb

    Joined:
    Sep 22, 2017
    Posts:
    12
    thank you!
    I´ve send you an E-Mail. *apply root motion' is switched off.
     
  14. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    But there is still 2 paths right? Or is there One??
    My thought to the issue was either make a ressource that was decrementet each time they blocked or completely remove the option to Block the entire path.

    how do i disable the ability to Block a path.
    How would i make and decerement of rsc when blocking.
     
  15. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    This is how you attach and AudioMixer via code.
    I have created a AudioMixer and first main Group is called "Master" then you can attach each subgroup like below.
    This code attach audiomixer group 2 to all protectiles and group 13 to speaker.

    the last code we change the OnBuildStart to use PlaySoundVoiceOver() instead of original.

    This is for anyone who want to regulate their sounds.

    private List<AudioSource> audioSourceListVoiceOcer = new List<AudioSource>();
    public AudioSource AudioSourceVoiceOver;

    public AudioMixer Mixer;

    void CreateAudioSource(){
    audioSourceList=new List<AudioSource>();
    for(int i=0; i<20; i++){
    GameObject obj=new GameObject("AudioSource"+(i+1));

    AudioSource src=obj.AddComponent<AudioSource>();
    src.playOnAwake=false; src.loop=false; src.volume=1; src.outputAudioMixerGroup = Mixer.FindMatchingGroups("Master")[2];


    obj.transform.parent=transform; obj.transform.localPosition=Vector3.zero;

    audioSourceList.Add(src);
    }

    audioSourceListVoiceOcer = new List<AudioSource>();
    GameObject obj1 = new GameObject("AudioSourceVoiceOver" + (1));
    AudioSource src1 = obj1.AddComponent<AudioSource>();
    src1.playOnAwake = false;
    src1.loop = false;
    src1.volume = 1;
    src1.outputAudioMixerGroup = Mixer.FindMatchingGroups("Master")[13];
    //src.spatialBlend=.75f;

    obj1.transform.parent = transform; obj1.transform.localPosition = Vector3.zero;

    audioSourceListVoiceOcer.Add(src1);

    }


    public static void PlaySoundVoiceOver(AudioClip clip, Vector3 pos = default(Vector3)) { if (instance != null) instance._PlaySoundVoiceOver(clip, pos); }


    public void _PlaySoundVoiceOver(AudioClip clip, Vector3 pos = default(Vector3))
    {
    if (clip == null) return;
    int Idx = 0;
    audioSourceListVoiceOcer[Idx].transform.position = pos;
    audioSourceListVoiceOcer[Idx].clip = clip; audioSourceListVoiceOcer[Idx].Play();
    }

    [Header("Sound Effect")]
    public AudioClip playerWon;
    public static void OnPlayerWon(){ if(instance!=null && instance.playerWon!=null) PlaySoundVoiceOver(instance.playerWon); }
    public AudioClip playerLost;
    public static void OnPlayerLost(){ if(instance!=null && instance.playerLost!=null) PlaySoundVoiceOver(instance.playerLost); }

    public AudioClip lostLife;
    public static void OnLostLife(){ if(instance!=null && instance.lostLife!=null) PlaySoundVoiceOver(instance.lostLife); }

    public AudioClip newWave;
    public AudioClip waveCleared;
    public static void OnNewWave(){ if(instance!=null && instance.newWave!=null) PlaySoundVoiceOver(instance.newWave); }
    public static void OnWaveCleared(){ if(instance!=null && instance.waveCleared!=null) PlaySoundVoiceOver(instance.waveCleared); }


    public AudioClip buildStart;
    public AudioClip buildComplete;
    public static void OnBuildStart(){ if(instance!=null && instance.buildStart!=null) PlaySoundVoiceOver(instance.buildStart); }
    public static void OnBuildComplete(){ if(instance!=null && instance.buildComplete!=null) PlaySoundVoiceOver(instance.buildComplete); }

    public AudioClip upgradeStart;
    public AudioClip upgradeComplete;
    public static void OnUpgradeStart(){ if(instance!=null && instance.upgradeStart!=null) PlaySoundVoiceOver(instance.upgradeStart); }
    public static void OnUpgradeComplete(){ if(instance!=null && instance.upgradeComplete!=null) PlaySoundVoiceOver(instance.upgradeComplete); }

    public AudioClip towerSold;
    public static void OnTowerSold(){ if(instance!=null && instance.towerSold!=null) PlaySoundVoiceOver(instance.towerSold); }


    public AudioClip perkPurchased;
    public static void OnPerkPurchased(){ if(instance!=null && instance.perkPurchased!=null) PlaySoundVoiceOver(instance.perkPurchased); }


    public AudioClip invalidAction;
    public static void OnInvalidAction(){ if(instance!=null && instance.invalidAction!=null) PlaySoundVoiceOver(instance.invalidAction); }
     
    jendrikb likes this.
  16. jendrikb

    jendrikb

    Joined:
    Sep 22, 2017
    Posts:
    12
    Hi @Niroan, is this a complete change of the AudioManager.cs or an extension?
     
  17. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    89
    @Niroan the multiple path thing is called "juggling" and is a strategy in every TD that has mazing. I wouldn't call it a bug. Part of your job as a game designer is to balance your game around that strategy.
     
  18. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    Just extension of songs script.
     
  19. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    I just want to disable it.
    For my game it makes no sense.
    Can you tell me How to disable please?
     
  20. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    89
    You disable it by not having branching paths in your level. If it makes no sense in your game then don't have user-created mazes in your game.

    If you want to adopt the option where mobs will attack the blocking tower you would want to find the place in the mob navigation that is listening for the tower built event. That triggers the mobs to update their path to a valid one when a tower is built. You could override that behavior and have them focus their attacks on the blocking tower instead. That would require some coding on your part however.

    Either way, selling a tower should give the user less resources than building the tower to counter the juggling strategy.
     
  21. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    just for you curiosity, Song allready gave me a fix for it. And its working just find with multiple branches.

    My game has a ressource that you Will gain more and more of. Its cloud based so you could have ALOT at some point. Pingpong between 2 paths until Money runs out is a no GO for me.

    i made it work and its really Nice Now. Thanks Song for always given fast help :)
     
    toddkc likes this.
  22. Sir-G

    Sir-G

    Joined:
    Mar 12, 2017
    Posts:
    20
  23. yannickgervais88

    yannickgervais88

    Joined:
    Sep 8, 2020
    Posts:
    3
    Hey Guys! Just a quick question about the framework. Can we use only sprites everywhere instead of models?
     
  24. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    Would i be possible to make it so Abilitys that has stock enabled need to be purchased globaly.
    Like this:

    You got 2 fireballs spells in stock. When you use 1 in the game, you only have 1 left.
    You decide to not use the last fireball. You start next map and now you have 1 fireball spell left out of 2.

    What i want is a way to store the spells and purchase them via mainmenu.
    So i can refill my spells before i go enter a map.

    As of now i believe that everytime i load a map. The stock will be refill?

    I really hope i can get this feature to work somehow.

    Thanks for amazing support so far Song.
    I made a 5 star rating for you
     
  25. Michael_2019

    Michael_2019

    Joined:
    Mar 4, 2019
    Posts:
    3
    Hello. Just got around to testing the asset. There was one question, albeit a stupid one. My layers were not imported when importing an asset. Where can I find a complete list of layers to record manually?
     
    Niroan likes this.
  26. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    89
    There aren't any layers imported. I think the TDTK.cs file has the layer info. Song has it set so the last few layers are used, even though they aren't setup in the Tags and Layers in project settings.
     
    Niroan likes this.
  27. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    Nice to know :) I read the turtorial and put them in manually :D
     
    toddkc likes this.
  28. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    BUMP
     
  29. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,638
    Sorry everyone for the slow respond. Once again the notification has failed to notify me about the new posts.

    @yannickgervais88, You can use sprites if you want to. The base mechanic of the framework is mostly detached from the visual aspect so you should be able to use any type of asset you want, 2D sprite or 3D model. That said, there are certain details that are coded for 3D model, like unit facing, turret aiming, etc. Depends on the type of sprites you want to use (the perspective), you may need to do a little code modification like disable the unit rotation and get the unit to display the correct sprite for the direction they are facing.

    @Niroan, You can do that by setting the ability to use a resource create exclusively for it in RscManager. Then use persistent resource by checking 'Carry Over' in RscManager (the value of the resource left at the end of the level will be carry to the next level). This is the only way it can be done. Anything else you would have to do your own modification.

    @Michael_2019, and everyone else I suppose, You can find the list of the layers used in TDTK.cs.
     
  30. stephenkolodychuk

    stephenkolodychuk

    Joined:
    Oct 1, 2020
    Posts:
    2
    @songtan Sorry if this question has been asked before, but is there a way to dynamically create towers at run time or enable/disable them from the build list during the game? I'm trying to add deckbuilding elements to my tower defense and couldn't see an easy way while poking around in the scripts.
    Edit: For clarification, the preferred way would be to generate a tower in code and assign it the needed values there. The less preferred, but other way I could think of, is to enable and disable the building of different towers that already exist.
     
    Last edited: Oct 1, 2020
  31. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,638
    You can use the perk system to add tower during runtime. However that is probably not very straight-foward to do for what you do. Unfortunately there's no way to remove tower atm. If you want to modify the script yourself. I would suggest you to start from UIBuildButton.cs where you can just show/hide individual buttons corresponding to the towers you want to enable/disable. If you enable all the towers in TowerManager, this should be pretty straight-forward as the order of the buttons will correspond to the order of the tower directly.
     
  32. stephenkolodychuk

    stephenkolodychuk

    Joined:
    Oct 1, 2020
    Posts:
    2
    The UIBuildButton solution works. Thanks for the help @songtan !
     
  33. ShadLandProjects

    ShadLandProjects

    Joined:
    Feb 24, 2015
    Posts:
    33
    What unity version is recommended?
     
  34. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    89
    I always use the most recent LTS version, so currently 2019.4 LTS. I haven't had any issues with that version and the TDTK.
     
  35. Sir-G

    Sir-G

    Joined:
    Mar 12, 2017
    Posts:
    20
    We all of a sudden started getting the following error for no reason, this is a critical issue and keeping us from moving forward. WE have checked everything and cannot see what is causing it. Has anyone else got this error before?

    NullReferenceException: Object reference not set to an instance of an object
    TDTK.TowerManager.Awake () (at Assets/Plugins/TDTK/Scripts/TowerManager.cs:62)

    NullReferenceException: Object reference not set to an instance of an object
    TDTK.CameraControl.Update () (at Assets/Plugins/TDTK/Scripts/CameraControl.cs:93)
     
  36. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    A bug:

    If you set tower build time to 5 seconds.
    Then you make 5 upgrades for tower that increase damage stat with 5 each.
    If you then start game and push the upgrade button, then fast push it again while its still upgrading. Then it resets the upgrade timer and takes money again. But it does not continue the upgrade it just starts the upgrade over.

    This is a huge bug cause you can keep doing this in good faith that you upgraded your towers. But they are not upgraded and just keep upgrading.

    Can i please get a fix for this :) Mayby it should not allow upgrade if timer for allready enabled upgrade is in progress?
     
  37. Michael_2019

    Michael_2019

    Joined:
    Mar 4, 2019
    Posts:
    3
    The asset does not have a separate layer for mines and various traps. If the road is fixed and protected from tower construction, then mines cannot be built on it. Is that how it should be?
     

    Attached Files:

  38. Michael_2019

    Michael_2019

    Joined:
    Mar 4, 2019
    Posts:
    3
    I am very confused by the lack of a discord server for support. Unity forums have long been outdated. Will there be a discord channel to support the asset in the future?
     
  39. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    In the Perk Manager there is a list of Perks.
    I want to update the Perks that have been updated if they are unlocked or not.
    How would i go and do this from another script?
     
  40. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,638
    @Michael_2019, Mine placement works like normal tower. My intention is for them to be used on walkable platform. As such, they can't be built on a 'blocked' area. That's said, there's a solution for what you are trying to do. You can split the platform into sections. One for the empty area beside the path and one on top of the path. Then you can set what tower availability on the platform themselves.

    @Niroan, I've fixed the bug you mentioned. I'll send you a fix shortly. As for the question about the perks, I'm not quite sure what the question is. If you want to update the perk display on UIPerkScreen, just call UpdateList() in UIPerkScreen.cs
     
    Niroan likes this.
  41. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49

    Hey Song

    i wanted to updated a json value with all perks purchased to cloud. Then on gamestart i wanted all the perks to loaded correctly. I made some hacks for your script and Got it working now.

    cause my currency is also in cloud. So i had to Update i everytime player bought perk :)

    that part is resolved now
     
  42. bastilar

    bastilar

    Joined:
    Apr 9, 2017
    Posts:
    16
    Hey Songtan,

    how do I find the code or way to make it so that if a person presses the "escape" key they can bring up the "pause menu". As it stands a person has to click the button, which can get annoying for a lot of people eventually.



    That way it's more inuititive. I'm trying to figure out what .cs file to edit or whatever it is i'm suppose ot edit but I'm stumped. Thanks!

    edit: I think i found what i'm looking for but trying to figure out how to add the escape key code, in uihudbutton.cs, i see this at the bottom:

    void OnPauseButton(GameObject butObj, int pointerID=-1){ UIPauseScreen.Show(); }

    I also need to figure out how to press escape key to close the pause menu as well.

    Thanks!

    Edit: i figured it out but I'm trying to figure out how to make it so that when i press escape, it preserves the correct cachetime scale for time.timescale.
     
    Last edited: Oct 22, 2020
  43. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49

    Can you just use the time.timescale = 1f?
     
  44. PotatoChips_2020

    PotatoChips_2020

    Joined:
    Sep 13, 2020
    Posts:
    2
    The effect of Damage over time does not appear to be working properly.
    I noticed a problem when I set multiple effects on the tower.

    I created a new project and placed a laser turret on it to make sure it wasn't working.
    When I loaded and played the demo scene, there were no errors.
    Is it just my environment?

    TDTK version is 4.0.5 f1.
    Unity version is 2019.04.10f1
     
  45. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,638
    @bastilar, You can use this to open and close pause menu when user press escape
    Code (csharp):
    1. void Update(){
    2.     if(Input.GetKeyDown(KeyCode.Escape)){
    3.         if(UIPauseScreen.IsActive()) UIPauseScreen.Hide();
    4.         else UIPauseScreen.Show();
    5.     }
    6. }
    You will need to add following line of code in UIPauseScreen.cs for that to work

    Code (csharp):
    1. public static bool IsActive(){ return instance!=null & instance.thisObj.activeInHierarchy; }
    I don't think you need to cache the timescale UIPauseScreen will handle that automatically when you call Show() and Hide().


    @PotatoChips_2020, Thanks for letting me know. There's indeed some bug with the effects and damage over time code (Nothing wrong with your environment). I'll get it fixed. If you need the fix asap, please let me know. I'll send it to you in advance when it's done.
     
  46. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    I would like to get fix aswell song
     
  47. PotatoChips_2020

    PotatoChips_2020

    Joined:
    Sep 13, 2020
    Posts:
    2
    @songtan
    Thanks for your reply.
    I'll wait for it to be fixed.
    I'm in no hurry.
     
  48. MaxiMaximaal

    MaxiMaximaal

    Joined:
    Dec 7, 2019
    Posts:
    3
    Hi! I cannot figure out how to get the animation for the creeps working properly, I believe it should be fairly simple, yet I cannot figure out what I am doing wrong. :/

    For example I used this free model: https://assetstore.unity.com/packages/3d/characters/toon-rts-units-demo-69687

    To set up the model I added a zeroed GameObject as parent with the Unit Creep script, so the animator with model is the child.
    Using the Animated Cube Prefab as reference I duplicated the TDUnitController for the Knight model. In this controller I have replaced the animations with the Knight one. (unavailable animations are set to ‘none’). Animation/model are both generic. The root motion is kept off. Culling mode set to always animate.

    This model is set as Prefab and added to the Creep Editor. Inside the editor the animator object is set to the layer with the animator attached. And corresponding clips are attached inside the clips windows.

    Yet still the characters are not animated and move frozen across the game.


    Few things I tried:

    - Extracting the animations from the FBX model by duplicating them.

    - Turning on/off root motion

    - Changing the model and animation to humanoid (Makes the character fall through its waist)

    - Removing the avatar from the animator

    - Changing culling modes

    - Changing updated methods

    - Adding box colliders / rigid bodies

    - Deleting unused layers/states in the AnimatorController

    - Using a duplicate version of the DummyController and replacing the animations that way. (That just sets the animation to be always moving)

    - Replacing/Adding Idle animations inside the empty state. (That just keeps the unit to be always idle)
     
  49. Niroan

    Niroan

    Joined:
    Jun 16, 2019
    Posts:
    49
    Maxi its real simple.

    Make a GameObject
    Make a child GameObject call it animator.
    Add the animator component.
    Add the animation controller from TDTK

    save it.

    go add the animation under the creeps setup all at the bottom of settings.

    press Play :)
     
  50. songtan

    songtan

    Joined:
    Apr 9, 2011
    Posts:
    2,638
    @MaxiMaximaal, You are doing everything right except you don't need to duplicate TDUnitController or modify anything in it. Just repeat what you did and assign the default TDUnitController to your animator and set the animation clips you want to use in CreepEditor (just leave whatever you don't need blank). The reason it's not working for you right now is that you probably haven't assign any animation clips to the CreepEditor so the code thinks you are not using the animation and thus not the call to play animation.

    Also the code will trying to create a runtime version of TDUnitController and replace the default animation clip with what you assigned in CreepEditor. So you don't need to manually duplicate multiple version of the controllers with one for each prefab.
     
    Niroan likes this.
unityunity