unity what is vector3 towards code example
Example: movetowards unity
//put this in update method and disable rigidbody2d (gravity)
void Update()
{
transform.position += (target - transform.position).normalized * movementSpeed * Time.deltaTime;
}
//put this in update method and disable rigidbody2d (gravity)
void Update()
{
transform.position += (target - transform.position).normalized * movementSpeed * Time.deltaTime;
}