Answers for "how to check wether an object has stopped moving unity"

C#
1

how to check wether an object has stopped moving unity

void Update()
{
	// "transform.hasChanged" is an official unity bool that checks whether all the tranform values have stopped (Position,Rotation,Scale)
	if (transform.hasChanged)
	{
		Debug.Log("The transform has changed!");
		transform.hasChanged = false;
	}
}
Posted by: Guest on July-18-2020
0

how to check wether an object has stopped moving unity

Rigidbody2D rb;

void Start()
{
    rb = GetComponent<Rgidbody2D>();
	IsStagnant(); 
}

void IsStagnant()
{
	if (Rigidbody2D.Isleeping())
    {
    	Debug.Log("Object is not moving")
    }
}
Posted by: Guest on July-18-2020

Code answers related to "how to check wether an object has stopped moving unity"

C# Answers by Framework

Browse Popular Code Answers by Language