How to recieve the quantity of the collisions with my collider after setting the position of the game object with this collider?
UPD: I have tried to do
using UnityEngine;
public class GettingQuantityOfCollisions : MonoBehaviour
{
private int QuantityOfTheObjectsInTheZone = 0;
public int GetQuantityOfTheObjectsInTheZone() => QuantityOfTheObjectsInTheZone;
private void OnCollisionEnter(Collision anyCollision) => QuantityOfTheObjectsInTheZone++;
private void OnCollisionExit(Collision anyCollision) => QuantityOfTheObjectsInTheZone--;
}
But it does not work when I set the transform.position of the game object with the collider directly.