How to change the processing order Node Event System?

I have 3 sprites, with the help of a script I change the rendering order and drag the sprites one on top of the other in reverse order.
The sprite that was at the bottom is obtained from above. But when you click on this stack again, it is not possible to take the top sprite.
Please tell me how can I solve this problem. I didn’t find a solution on the forum.

import { _decorator, Component, Node, input, Input, Event, Vec2, Label, KeyCode, EventMouse, EventTarget} from ‘cc’;
import{GameManager} from “./GameManager”;
const { ccclass, property } = _decorator;

export class TouchDragger extends Component {

onLoad() {
    this.node.on(Node.EventType.TOUCH_START, (event) => { 
    console.log('Touch start');
    event.propagationStopped = true;

    }, this);

    this.node.on(Node.EventType.TOUCH_MOVE, (event) => { 
    this.node.setPosition(this.node.getPosition().x + event.touch.getDelta().x , this.node.getPosition().y + event.touch.getDelta().y, 0);
    }, this);

    this.node.on(Node.EventType.TOUCH_END, (event) => { 
    console.log('Touch end');

    event.propagationStopped = false;
    }, this);


It should be like a card game where the deck is shuffled and the topmost card can be dragged.

Nobody can answer?

Which version is used? Can you provide a simple demo? Every node is registered for events?

Version 3.6. I attach the presented script to each of the three nodes. So far this is an experiment with three sprites. I created nodes both in the editor and denamically in the script,
but the result is the same - this.node.setSiblingIndex(2) changes the rendering order, but does not remember the event processing order, and when you click on the visually top sprite again, the old node processing order is preserved.

Nodes/sprites are brothers. Tried making them children of the Canvas or children of the child node of the Canvas, the result is the same. In previous versions of the engine - target.setLocalZOrder(1) - solved the problem.

I will be grateful for any help!

event.propagationStopped = true;event.preventSwallow = true;
Maybe you need this

I use this in a script, does not solve the problem!


This is a bug, has created an issue.

if you need,you can delete this code, and recompile engine.
Sorting can be time consuming and may affect performance.
File path:3.6.0\resources\resources\3d\engine\cocos\2d\event\pointer-event-dispatcher.ts

Koei, thanks for your help! I hope the developers fix the bug. I think sorting is one of the main functions.