Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. start by opening up the TitanAnimatorController, the attack states are to the right
  2.  
  3. right click -> create state -> empty, set the motion to the animation you want, make the name start with "Attack" for consistency, right click it and make it transition to the red exit node
  4.  
  5. click on the transition line and make sure has exit time is checked and is close to 1, basically if it's at 1 the entire animation will play, if it's at 0.8 it will transition out of the animation when it's 80% complete
  6.  
  7. back on the state you just made, click add behaviour and add SmbTitanNotBusyOnExit & SmbTitanAttackState, if the animation uses core bone movement, also add SmbTitanUpdateCore
  8.  
  9. if the animation won't start from AI, like the jump landing pose which activates the feet hitboxes to squish players, set the Attack Type to none, otherwise you'll have to add a new attack type in the code
  10.  
  11. but first, set the 'number of states' to how many hitbox states there are in the attack, like if the animation has the right arm swing and then the left one, that's 2 states, another example is the combo animation has 3 states, the right slap, the left slap and then the overhead slam, the punk slaps only have 1 state
  12.  
  13. in the hitboxes dropdown select any combination of hitboxes that should be enabled (if you need more hitboxes that aren't set up already it's more work lol)
  14.  
  15. for the start & end timings, look at the animation previews (select the TITAN_VER3 model and see the preview animations) if you drag the slider around, the percentage at the bottom is what you use for timing - if the hitbox should be enabled at 32.7%, set the start time to 0.327, if it should end at 50%, set end time to 0.5. if the hitboxes should be enabled in the entire animation, just tick the 'active entire state' checkbox
  16.  
  17. now to add a new 'Attack Type' for the dropdown, open Titan.cs, scroll to the Enums region, in the AttackType enum add another that easily identifies it (for this example "Backflip")
  18. then scroll up to the constants region, add a new variable under the states that are prefixed with "stateAttack", so stateAttackBackflip and set the text to the name of the state you made
  19.  
  20. then scroll down to the Methods region, look for the method 'Attack' that takes an AttackType parameter, add another case in there for the one you just made (AttackType.Backflip), and use stateAttackBackflip in the CrossFade method
  21.  
  22. then scroll down to Unity Methods region, find FixedUpdate, inside yo'll see a bunch of these:
  23. if (WillAttackHit(AttackType.SlapR))
  24. {
  25. Attack(AttackType.SlapR);
  26. }
  27.  
  28. add another for the new attack type you made (and we're nearly done)
  29.  
  30. ........
  31.  
  32. finally go back Unity, then open Window -> Titan AI Data
  33. in the Titan GameObject slot, drag Titan from the hierarchy in there, for AI Data Object, click the tiny circle on the right of the box and select the only thing available, for animator controller click the circle again and choose TitanAnimatorController, then finally press Aggregate Dat Data (lol)
  34.  
  35. hopefully the console says nothing went wrong, and you'll notice the titan is now in a punk slap pose or something, click on the titan in the hierarchy, and at the top of the inspector press the revert button (remember to also look at the Titan script in the inspector and set the attack target to Human again) and I think that's it
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement