backslash-f / realitykit-swiftui

RealityKit + SwiftUI demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How would you go about adding a button that clears the AR scene?

tavst3r opened this issue · comments

Hello!

The project is great! I am trying to learn Swift and AR developing and I was wondering how would you go about adding a button that removes all the 3d objects form the AR scene. Could you help me with this?

Thank you!

Hi!

Yeah, this was a good exercise.

ChatGPT helped me on this one 😁: chatgpt.txt

So:

  1. Set a name for the entities to be added to the scene: ff1a7f5
  2. Add the removal capability to the ARViewRepresentable: f2c75ca
  3. Add the delete button + state: 81c5f93

Profit:

remove_all.mp4

Thank you!