<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/Entity/moveCharacter(by:deltaTime:relativeTo:collisionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation6EntityC13moveCharacter2by9deltaTime10relativeTo16collisionHandlerAA0E19ControllerComponentV14CollisionFlagsVs5SIMD3VySfG_SfACSgyAJ0O0VcSgtF"
  },
  "title" : "moveCharacter(by:deltaTime:relativeTo:collisionHandler:)"
}
-->

# moveCharacter(by:deltaTime:relativeTo:collisionHandler:)

Moves the character along a specified vector over a period of time.

```
@discardableResult @MainActor @preconcurrency func moveCharacter(by moveDelta: SIMD3<Float>, deltaTime: Float, relativeTo referenceEntity: Entity?, collisionHandler: ((CharacterControllerComponent.Collision) -> Void)? = nil) -> CharacterControllerComponent.CollisionFlags
```

## Parameters

`moveDelta`

Delta vector to attempt to move capsule in collision world.

`deltaTime`

Time between last frame and current.

`referenceEntity`

Reference entity that defines the frame of reference of the move delta.
Can be `nil`, which is equivalent to “world space”.

`collisionHandler`

Optional callback when an entity was hit. One call per each hit entity.

## Return Value

Collision flags that indicate the location of the collision.

## Discussion

Moves the character in the collision world, with continuous collision checking and response.
This will create character collision events.
Entity.transform will be updated on the next engine tick.
Use `CharacterControllerStateComponent` to get additional information about the state of the character after the move.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)