Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to play animation with code in unity

public GameObject ExampleNPC;

void Update()
{
    if(Input.GetButtonDown("Animation")) // Make sure to refrence this in Input settings
    {
        ExampleNPC.GetComponent<Animator>().Play("Anim name");
    }
}
Comment

play animation through script unity

animator.Play("StateName");
Comment

PREVIOUS NEXT
Code Example
Csharp :: debug.log 
Csharp :: c# console clear 
Csharp :: getmousebuttondown unity 
Csharp :: database update dotnet 
Csharp :: LINQ query to select top 5 
Csharp :: c# mongodb update multiple fields 
Csharp :: Pass Querystring in C# httpclient 
Csharp :: raylib c# 
Csharp :: roman 
Csharp :: get tree node godot 
Csharp :: windows form textbox password 
Csharp :: wpf arrow button 
Csharp :: webclient timeout 
Csharp :: how to save a dictionary as a csv file in c# 
Csharp :: Customize yup number 
Csharp :: how to set picturebox width with form width in c# 
Csharp :: datetime default c# 
Csharp :: or in if statement c# 
Csharp :: c# get all namespaces in assembly 
Csharp :: c# replace dash in string 
Csharp :: how to write a list to csv c# 
Csharp :: c# round number up 
Csharp :: c# is odd number 
Csharp :: system.net.mail send html message 
Csharp :: how to close a form c# 
Csharp :: how to locate a specific element in a list c# 
Csharp :: how to add to a list only items that are not already in the list c# 
Csharp :: Kill System Process in C# 
Csharp :: asp.net core identity get all roles 
Csharp :: how to set border for groupbox in c# 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =