void LateUpdate() { Ray ray = new Ray(transform.position, new Vector3(0, 0, 1)); RaycastHit hitInfo = new RaycastHit(); if (m_fluid.GetComponent <Collider>().Raycast(ray, out hitInfo, 10)) { float fWidth = m_fluid.GetComponent <Renderer>().bounds.extents.x * 2f; //float fHeight = m_fluid.renderer.bounds.extents.z * 2f; float fRadius = (GetRadius() * m_fluid.GetWidth()) / fWidth; m_fluid.AddObstacleCircle(hitInfo.textureCoord, fRadius, false); } }