function plotSim3d(obj, varargin)
    % plotSim3d(s) opens the Unreal Game Engine viewer with a birdseye veiw of the drivingScenario (s) and synchronizes
    % it

    %   Copyright 2023 The MathWorks, Inc.

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % get the handle to any open instances of the scenario viewer %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    viewer = driving.scenario.GamingEngineScenarioViewer.getInstance;

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % if the handle is not empty, get the drivingScenario object from it %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    if ~isempty(viewer)
        otherScenario = viewer.DrivingScenario;
    else
        otherScenario = [];
    end % end if handle not, else, empty

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % if we have already created plots for the scenario and one of them is the sim3d plot %
    % delete the sim3d object before creating a new one, but keep all other plot objects  %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    if ~isempty(otherScenario) && (numel(otherScenario.Plots) > 0) ...
                               && isa(otherScenario.Plots(1), "driving.scenario.GamingEngineScenarioViewer")
        otherScenario.Plots(1).delete;
        if ~isempty(otherScenario.Plots)
            otherScenario.Plots(1) = [];
        end
    else
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        % else, check for timer and delete it if it exists %
        % the constructor for the gaming engine remakes it %
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        tmr = timerfind("Name", "TimeToPause");
        if ~isempty(tmr)
            tmr.delete;
        end % end timer found
    end % end if, else not, an instances of the viewer to delete

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % construct the new viewer %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%
    driving.scenario.GamingEngineScenarioViewer.getInstance(obj, varargin{:});
end % end function plotSim3d