---
title: "loadBodyTracked(named:in:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/entity/loadbodytracked(named:in:)"
---

# loadBodyTracked(named:in:)

Synchronously loads a body-tracked entity from a bundle.

## Declaration

```swift
@MainActor @preconcurrency static func loadBodyTracked(named name: String, in bundle: Bundle? = nil) throws -> BodyTrackedEntity
```

## Parameters

- `name`: The base name of the file to load, omitting the filename extension.
- `bundle`: The bundle containing the file. Use nil to search the app’s main bundle.

## Mentioned in

Loading entities from a file

## Return Value

Return Value The root entity in the loaded file, cast as a BodyTrackedEntity.

## Discussion

Discussion Loading an Entity with this method blocks the main actor because it’s synchronous, so only call it from a command-line application. The method can stall a regular app, which makes it visibly hitch, and the system terminates an app if its UI becomes unresponsive. See init(named:in:) for an example that demonstrates how to safely load content.

## See Also

### Loading a flattened body-tracked entity

- [loadBodyTracked(contentsOf:withName:)](realitykit/entity/loadbodytracked(contentsof:withname:).md)
- [loadBodyTrackedAsync(contentsOf:withName:)](realitykit/entity/loadbodytrackedasync(contentsof:withname:).md)
- [loadBodyTrackedAsync(named:in:)](realitykit/entity/loadbodytrackedasync(named:in:).md)
