Hobby Game Dev Log -10- BossFight!
https://www.youtube.com/watc...https://discord.gg/6STRB2n7pf
https://twitter.com/M_attTaylor
I run you through how I made the boss of my game. Let me know what you think or if you have any questions.
**Update**
Use animator.Crossfade("animationName", "transition duration") for 3d projects instead of animator.Play()
https://docs.unity3d.com/ScriptReference/Animator.CrossFade.html
Example:
public string currentState;
public void SetAnimationState(string newState, float transitionTime)
{
if (currentState == newState) return;
if (_animator.IsInTransition(0) && !_animator.GetCurrentAnimatorStateInfo(0).loop) return;
_animator.CrossFade(newState, transitionTime);
currentState=newState;
}
#gamedev #indiedev #unity