Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity 2d platformer movement script rigidbody

float acceleration = grounded ? walkAcceleration : airAcceleration;
float deceleration = grounded ? groundDeceleration : 0;

// Update the velocity assignment statements to use our selected
// acceleration and deceleration values.
if (moveInput != 0)
{
	velocity.x = Mathf.MoveTowards(velocity.x, speed * moveInput, acceleration * Time.deltaTime);
}
else
{
	velocity.x = Mathf.MoveTowards(velocity.x, 0, deceleration * Time.deltaTime);
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: google tradutor 
Csharp :: asp net core send email async 
Csharp :: run as administrator vs 2019 
Csharp :: how to change the width of a panel unity 
Csharp :: c# declaration definition 
Csharp :: Task w = Task.Delay(600);w.Wait();new Program().Start(); 
Csharp :: unity ik nothing is happening 
Csharp :: rb.addforce 3d c# 
Csharp :: C# convert random numbers in textBox to currency 
Csharp :: wpf scoll to on new item datagrtid 
Csharp :: black lives matter update arsenal 
Html :: html dollar symbol 
Html :: how to link css to html 
Html :: how to open link in a new tab 
Html :: bootstrap 4 cdn 
Html :: how to center html heading 
Html :: pattern for email id in html 
Html :: verbalna komunikacija 
Html :: svg content_type 
Html :: accepts audio file in html 
Html :: conveert text to uppercase in input field 
Html :: vuejs double click 
Html :: sample html file 
Html :: html skype call 
Html :: textarea placeholder 
Html :: link phone number mail html 
Html :: markdown: text size 
Html :: conda update base 
Html :: markdown collapsible list 
Html :: laravel csrf fields 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =