Skip to content

Instantly share code, notes, and snippets.

View durul's full-sized avatar

durul dalkanat durul

View GitHub Profile
@MainActor
func placeInRealityView(modelURL: URL, into content: RealityViewContent, under parent: Entity?) async throws {
let entity = try await ModelEntity(contentsOf: modelURL)
var mc = ManipulationComponent()
ManipulationComponent.configureEntity(entity, collisionShapes: nil)
entity.components.set(mc)
let anchor = AnchorEntity(world: .zero)
content.add(anchor)
anchor.addChild(entity)