2

I'm currently working on an AR app and I want to trigger an action (for example a scene change) only when a button was pressed beforehand. Here's the process I'm trying to build:

  1. Object spawns in front of user

  2. User taps on button to select a tool

  3. User taps on the object and the action sequence from the RC project gets triggered

So far I created a the initial loading of the Scene,

guard let anchor = try? Excavation.loadDirtpile() else {
    return
}

a variable for the button state

var shovelPressed: Bool = false

And a function that sets the state

@IBAction func shovelButtonPressed(_ sender: Any) {
    shovelPressed = true
}

This is my first time working with Swift and Reality Composer so I'm quite confused :D

I hope you can help!

Oliver
  • 25
  • 1
  • 6

0 Answers0