diff --git a/Modules/GameEngineKit/Sources/_NewSystem/Views/DragAndDrop/DragAndDropBaseScene.swift b/Modules/GameEngineKit/Sources/_NewSystem/Views/DragAndDrop/DragAndDropBaseScene.swift index 8d6bc5c8c7..9e11b534e7 100644 --- a/Modules/GameEngineKit/Sources/_NewSystem/Views/DragAndDrop/DragAndDropBaseScene.swift +++ b/Modules/GameEngineKit/Sources/_NewSystem/Views/DragAndDrop/DragAndDropBaseScene.swift @@ -162,6 +162,7 @@ class DragAndDropBaseScene: SKScene { func wrongAnswerBehavior(_ node: DraggableImageAnswerNode) { snapBack(node) + disableWrongAnswer(node) } func onDragAnimation(_ node: SKSpriteNode) { @@ -198,6 +199,14 @@ class DragAndDropBaseScene: SKScene { } } + private func disableWrongAnswer(_ node: DraggableImageAnswerNode) { + let gameplayChoiceModel = viewModel.choices.first(where: { $0.choice.value == node.name })! + if gameplayChoiceModel.choice.dropZone == nil { + node.colorBlendFactor = 0.4 + node.isDraggable = false + } + } + override func didMove(to view: SKView) { self.reset() }