Hello,

Can you help me achieve this functionality.

In floormaps, we create room with the help of points (i.e whenever we create atleaset 3 points a room along with its walls are created).

But I want to Create room when we swipe instead of points,

explanation - when we swipe in floormap editor scene, I want to create two points, one at the start of touch and other at the end of touch, and once the touch phase ends, I need to create a room with 2 points (only one wall), now if we again swipe a new wall will be created within the same room.

Thanks.

    RandhirP You will have to add your own logic to find points on the floor when you press and release, then using these points you can place control points on the floor using the CreateControlPointBasedOnNormalizedPosition() method. I suggest you duplicate it like this to accept 3d positions:

    public ControlPoint CreateControlPointBasedOnWorldPosition(Vector3 worldPos, bool useThickness = false, uint index = uint.MaxValue, bool sendEvent = true)
    {

           worldPos.y = 0;
    
            GameObject copy = Instantiate(prefabPoint, worldPos, Quaternion.identity, transform);
            ControlPoint copyCP = copy.GetComponent<ControlPoint>();
            copyCP.cpc = this;
            copyCP.normalizedPosition = normalizedPosition;
            copyCP.usePosition = true;
            copyCP.enableWidthLine = drawWidth;
            copyCP.width = width;
            copyCP.isGhost = (false);
            copyCP.UpdateLabel();
            copyCP.gameObject.name = "CP" + index;
            globalIndex = index + 1;
            if (sendEvent)
            {
                OnControlPointsChanged?.Invoke();
            }
            return copyCP;
        }

    after the two points are placed, you will have to call

    cpc.CreatePathVisualization();
    cpc.OnControlPointsChanged?.Invoke();

      Write a Reply...