Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity werfen mit höhe

Vector3 CalculateLaunchVelocity(Vector3 from, Vector3 to, float height) 
{
	float displacementY = to.y - from.y;
	Vector3 displacementXZ = new Vector3(to.x - from.x, 0, to.z - from.z);
	
	Vector3 velocityY = Vector3.up * Mathf.Sqrt(-2 * gravity * height);
	Vector3 velocityXZ = displacementXZ / (Mathf.Sqrt(-2 * height / gravity) + Mathf.Sqrt(2 * (displacementY - height) / gravity));
	
	return velocityXZ + velocityY;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# remove invalid directory characters 
Csharp :: iterate through photon player gameobjects 
Csharp :: how to change text in richtextbox wpf 
Csharp :: push c# array 
Csharp :: listview thread error 
Csharp :: render world space UI infront of everything unity 
Csharp :: unity pickup and drop objects 
Csharp :: batchblock timeout 
Csharp :: What are logic gates? 
Csharp :: c sharp convert string time into 24 hours time 
Csharp :: unity draw waypoins path 
Csharp :: How to create a Blazor server-side application in command prompt 
Csharp :: spin with rigidbody 2d unity 
Csharp :: how to exit winforms application and shutdown pc in c# 
Csharp :: how to make a character jump c# 
Csharp :: C# check if object is default 
Csharp :: c# query string builder 
Csharp :: C# http post request with file 
Csharp :: c# draggable controls 
Csharp :: convert word files to plain text c# 
Csharp :: how to iterate a generic list in c# 
Csharp :: do while loop in c# 
Csharp :: C# random multiple of 5 in range 
Csharp :: StringFormat C# 
Csharp :: color rgb to float c# 
Csharp :: c# convert bool to string 
Csharp :: elasticsearch nested aggregation in c# 
Csharp :: static initializer 
Csharp :: ado stands for 
Csharp :: unity unit testing 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =