Developed a series of squares in Reality Composer Pro and used Xcode to implement tap gestures, hover effects, and interactive 3D buttons.

An August 18 weekend - Sharm

HoverEffectSave.gif


⚠️Optimization led me to consolidate everything into a single object. [jump to Optimization?]

However, an error occurred because the targetedToEntity method expects a single Entity, but I was passing an array of ButtonEntity objects (buttons).

Fix’d 😊


1. Xcode|RCP Setup

Building a stage with buttons in Xcode and RCP. Setting up the overall xcode project and begin the setup of 3D buttons inside Reality Composer Pro.

  1. Create a new Mixed immersive scene

    Screenshot 2024-08-17 at 8.01.48 AM.png

  2. Starter file Content View

        VStack {
            Model3D(named: "Scene", bundle: realityKitContentBundle)
                .padding(.bottom, 50)

            Text("Hello, world!")

            ToggleImmersiveSpaceButton()
        }

We can use model3D to bring in the individual buttons, but we will try to fetch it using root entity since all the buttons will be inside the root of the model.