Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

How can I simultaneously apply the drag gesture to multiple entities?

I wanted to drag EntityA while also dragging EntityB independently.

I've tried to separate them by entity but it only recognizes the latest drag gesture

RealityView { content, attachments in
 ...
}
.gesture(
    DragGesture()
        .targetedToEntity(EntityA)
        .onChanged { value in
            ...
        }
)
.gesture(
    DragGesture()
        .targetedToEntity(EntityB)
        .onChanged { value in
            ...
        }
)

also tried using the simultaneously but didn't work too, maybe i'm missing something

.gesture(
    DragGesture()
        .targetedToEntity(EntityA)
        .onChanged { value in
            ...
        }

        .simultaneously(with:
            DragGesture()
                .targetedToEntity(EntityB)
                .onChanged { value in
                    ...
                }    
)

Hi @jeremiespoken , (I realize it's been a bit since you posted, but in case others come across this)

Have you tried using .simultaneousGesture for both? So like:

RealityView {
}
  .simultaneousGesture(DragGesture()
            .targetedToEntity(cube)
            .onChanged({ value in
// ...
            }))
        .simultaneousGesture(DragGesture()
            .targetedToEntity(otherCube)
            .onChanged({ value in
// ...
            }))
How can I simultaneously apply the drag gesture to multiple entities?
 
 
Q