mike_t
mike_t

Reputation: 2691

Swift 4 - SpriteKit over SceneKit - prevent touch for underlying camera controls

I'm quite new to Swift development. In my project i have a SpriteKit overlaying the SceneKit scene with allowsCameraControl set to true.

The SpriteKit layer contains buttons - what is the best way to disable the touch/pan events to trigger camera controls when these buttons are interacted with? (e.g. double tap on a button now triggers camera reset to default position)

Upvotes: 1

Views: 507

Answers (1)

Xartec
Xartec

Reputation: 2415

Turn off allowsCameraControl and implement your own camera controls instead. The allowsCameraControl is handy for testing/debugging purposes and cannot be disabled partly such as for the doubletap behavior only. Which besides conflicts with other gestures gets annoying as a double tap is easily made by accident and resets the screen.

Upvotes: 2

Related Questions