Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

function on animation exit unity

// 1. click on the animation state block in the animator and in the inspector
// 2. click Add Behavior button and edit that new script
// 3. find the OnStateExit function and un-comment it. Example below.

// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
  GameObject self = animator.gameObject; //a reference to the gameobject being animated
  MyScript script = self.GetComponent<MyScript>();
  Debug.Log("Animation has finished!");
  script.SendMessage("MyFunction"); //this is the name of the function to call
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity call function on animation onstateexit 
Csharp :: c# find substring in string 
Csharp :: c# for loop next iteration 
Csharp :: wpf app how to get all elements 
Csharp :: Configure Automapper 
Csharp :: how to make text show a variable in unity 
Csharp :: lock pc using c# 
Csharp :: c# set datetime to null value 
Csharp :: getmousebuttondown unity 
Csharp :: how can prevent the empty input in jquery 
Csharp :: ef rollback migration 
Csharp :: c# turn negative number into positive 
Csharp :: array join c# 
Csharp :: string to datetime c# 
Csharp :: Gameobject.Find in unityC# 
Csharp :: c# how does comparing datetime work 
Csharp :: if file exist rename c# 
Csharp :: 2d list c# 
Csharp :: lcm of list of number 
Csharp :: char to digit in java 
Csharp :: c# get all namespaces in assembly 
Csharp :: override gethashcode 
Csharp :: ternary operator c# 
Csharp :: how to set foreground from code wpf 
Csharp :: how to remove all whitespace from a string in c# 
Csharp :: print all complete object in list c# 
Csharp :: c# display image 
Csharp :: unity banner Ad position 
Csharp :: first person mouse look unity 
Csharp :: c# add 2 arrays 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =