Entity not reacting to light and not casting shadow in VIsionOS Simulator

Hi Guys, I've been trying to put my model to react to light in visionOS Simulator by editing the component in Reality Composer Pro and also modifying it by code, but I can only put the shadow if I put it as an usdz file, it's not as reflective as when I see it on reality converter or reality composer pro, does someone have this problem too?

RealityView { content in
    
    if let bigDonut = try? await ModelEntity(named: "bigdonut", in: realityKitContentBundle) {
        
        print("LOADED")
        
        // Create anchor for horizontal placement on a table
        let anchor = AnchorEntity(.plane(.horizontal, classification: .table, minimumBounds: [0,0]))
        
        // Configure scale and position 
        bigDonut.setScale([1,1,1], relativeTo: anchor)
        bigDonut.setPosition([0,0.2,0], relativeTo: anchor)
        
        // Add the anchor
        content.add(anchor)
        
        // Enable shadow casting but this does not work
        bigDonut.components.set(GroundingShadowComponent(castsShadow: true))
    }
    
}

GroundingShadowComponent(castsShadow: true) needs to be applied to the first layer you have that actually has the mesh. In Apple language sometimes called the ModelEntity. Probably bigDonut has an extra /Root layer, so you need to dig into the children, find the ModelEntity and apply the shadow there.

Entity not reacting to light and not casting shadow in VIsionOS Simulator
 
 
Q