Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
title: AvatarAbilities library
description: The AvatarAbilities library allows developers to utilize new features from the Character Controller Library in their game.
---

The **AvatarAbilities** library is a table of functions and values used to set up and configure the [Character Controller Library](./index.md) (CCL). The library is accessed via `require("@rbx/AvatarAbilities")`.

## API Reference

### Functions

#### initializeServer

<figcaption>
initializeServer()
</figcaption>

Initializes the server-side system and allows proper set up of the CCL for characters. This function only works on the server, and trying to run it on the client will do nothing. This function automatically runs on the server using a script in `Class.ServerScriptService` if the CCL is enabled in Studio's [Avatar Settings](../../studio/avatar-settings.md) window.

The following is the code used to initialize the server when CCL is enabled.

```lua title="AvatarAbilitiesServerScript" highlight="6"
require("@rbx/AvatarAbilities").initializeServer()
```

#### initializeCharacter

<figcaption>
initializeCharacter(character: `Class.Model`)
</figcaption>

Sets up the CCL for the character that the function is ran on. This function automatically runs on both the server and the client using scripts in the AbilityManagerActor if the CCL is enabled in Studio's [Avatar Settings](../../studio/avatar-settings.md) window. Note that this function currently doesn't return anything, but it will in the future.

The following is the code used to initialize the character when CCL is enabled.

```lua title="ServerInitialize / ClientInitialize" highlight="6"
local AvatarAbilities = require("@rbx/AvatarAbilities")

local actor: Actor = script.Parent :: Actor
assert(actor:IsA("Actor"))
local character: Model = actor.Parent :: Model
assert(character:IsA("Model"))

local abilityManager = AvatarAbilities.initializeCharacter(character)
```

#### initializeClient

<figcaption>
initializeClient()
</figcaption>

Initializes the client-side system and automatically initializes . Note this is currently unused, but in the future, this will likely be used.

### Properties

#### mode

Exposed for external queries. A string value that identifies what the ServerAuthority mode is. Can be equal to `"None"`, `"Automatic"`, or `"Server"`.

#### isServerAuth

Exposed for external queries. A bool value that is equal to `mode == "Server"`

#### isAutoAuth

Exposed for external queries. A bool value that is equal to `mode == "Automatic"`

#### sAuthBetaEnabled

Exposed for external queries. A bool value that is equal to `mode ~= "None"`
6 changes: 6 additions & 0 deletions content/en-us/reference/engine/globals/LuaGlobals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@ functions:
- Paths with the `../` prefix begin resolution at `script.Parent.Parent`.
- Paths with the `@self/` prefix begin resolution at `script`.
- Paths with the `@game/` prefix begin resolution at `game`.
- Paths with the `@rbx/` prefix begin resolution nowhere, and instead
downloads the Roblox platform library with the given name and returns it.
- Each non-prefix component in a given path corresponds to a child
instance of the previous component. The exception to this is the `..`
component, which corresponds to the parent of the previous component.
Expand Down Expand Up @@ -561,6 +563,10 @@ functions:
-- "@game" prefix corresponds to the DataModel root
require("@game/ReplicatedStorage/Shared/MyModule")
require((game).(ReplicatedStorage).(Shared).(MyModule))

-- "@rbx" prefix corresponds to nowhere, or game.PlatformLibraries if the library was already loaded.
-- However, normal scripts cannot use game.PlatformLibraries
require("@rbx/AvatarAbilities")
```

Once the return object is created by an **initial**
Expand Down
Loading