# AgentInfo

Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0

<div class="api-meta">
<span class="api-kind api-kind-class" data-pagefind-filter="kind:Class">Class</span>
<span data-pagefind-filter="namespace:Sansar.Simulation">Namespace <a href="/scripting/api/sansar.simulation"><code>Sansar.Simulation</code></a></span>
<span>Inherits <a href="/scripting/api/sansar.script/instanceinterface">Sansar.Script.InstanceInterface</a></span>
</div>

<span id="T:Sansar.Simulation.AgentInfo"></span>

The AgentInfo class has basic information and IDs for an agent.

```csharp
public class AgentInfo : Sansar.Script.InstanceInterface
```

## Remarks

Agents may leave at any time. Attempting to use an AgentInfo interface for an agent no longer in the scene will throw a NullReferenceException.

## Members at a glance

| Kind | Members |
|---|---|
| **Properties** | [AvatarUuid](#avataruuid) · [Handle](#handle) · [Name](#name) · [ObjectId](#objectid) · [Scale](#scale) · [SessionId](#sessionid) · [Ticket](#ticket) |
| **Methods** | [ToString](#tostring) |

## Properties

### AvatarUuid

<div class="api-card">
<span id="P:Sansar.Simulation.AgentInfo.AvatarUuid"></span>

```csharp signature
public Guid AvatarUuid { get; }
```

Returns the persona ID of the AgentInfo.

**Value:** [Guid](https://learn.microsoft.com/dotnet/api/system.guid) — The persona ID of the AgentInfo

<details class="api-remarks"><summary>Remarks</summary>

Agent persona IDs are unique

</details>

</div>

### Handle

<div class="api-card">
<span id="P:Sansar.Simulation.AgentInfo.Handle"></span>

```csharp signature
public string Handle { get; }
```

Returns the handle of the AgentInfo.

**Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The handle of the AgentInfo

<details class="api-remarks"><summary>Remarks</summary>

Agent handles are unique.

</details>

</div>

### Name

<div class="api-card">
<span id="P:Sansar.Simulation.AgentInfo.Name"></span>

```csharp signature
public string Name { get; }
```

Returns the name of the AgentInfo.

**Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The name of the AgentInfo

<details class="api-remarks"><summary>Remarks</summary>

Agent names may not be unique.

</details>

</div>

### ObjectId

<div class="api-card">
<span id="P:Sansar.Simulation.AgentInfo.ObjectId"></span>

```csharp signature
public Sansar.Script.ObjectId ObjectId { get; }
```

Returns the ObjectId of the AgentInfo.

**Value:** [Sansar.Script.ObjectId](/scripting/api/sansar.script/objectid) — The object ID of the AgentInfo

<details class="api-remarks"><summary>Remarks</summary>

The object id can be used to compare agents or look up the [`ObjectPrivate`](/scripting/api/sansar.simulation/objectprivate) associated with the agent.

</details>

</div>

### Scale

<div class="api-card">
<span id="P:Sansar.Simulation.AgentInfo.Scale"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 33.2.0</span></div>

```csharp signature
public float Scale { get; }
```

Returns the scale for the user.

**Value:** [float](https://learn.microsoft.com/dotnet/api/system.single) — The scale of the user

<details class="api-remarks"><summary>Remarks</summary>

This is the scale setting from the character editor.

</details>

</div>

### SessionId

<div class="api-card">
<span id="P:Sansar.Simulation.AgentInfo.SessionId"></span>

```csharp signature
public Sansar.Script.SessionId SessionId { get; }
```

Returns the Id of the AgentInfo.

**Value:** [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) — The id of the AgentInfo

<details class="api-remarks"><summary>Remarks</summary>

The id can be used for quick comparison between Agents.

</details>

</div>

### Ticket

<div class="api-card">
<span id="P:Sansar.Simulation.AgentInfo.Ticket"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 31.1.0</span></div>

```csharp signature
public string Ticket { get; }
```

Returns the ticket for the user if they purchased one.

**Value:** [string](https://learn.microsoft.com/dotnet/api/system.string) — The ticket of the user

<details class="api-remarks"><summary>Remarks</summary>

Will be an empty string if no ticket was used to enter the scene or event.

</details>

</div>


## Methods

### ToString

<div class="api-card">
<span id="M:Sansar.Simulation.AgentInfo.ToString"></span>
<span id="M:Sansar.Simulation.AgentInfo.ToString()"></span>

```csharp signature
public override string ToString()
```

A string representation of this object.

**Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.

<details class="api-remarks"><summary>Remarks</summary>

The format of this string may change between releases.

</details>

</div>


## Used in examples

- [MoverExample1.cs](/scripting/examples/mover-examples)
- [MoverExample3.cs](/scripting/examples/mover-examples)
- [ReflectiveDetectorExample.cs](/scripting/examples/reflective-detector)
- [StatsExample.cs](/scripting/examples/stats-example)
- [TeleportHotkeys.cs](/scripting/examples/teleport-hotkeys)
- [VisitorTrackerExample.cs](/scripting/examples/visitor-tracker)
- [BanHammerExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/BanHammerExample.cs)
- `CameraShakeExample.cs`
- [CastRayExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CastRayExample.cs)
- [CoroutineEventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CoroutineEventExample.cs)
- [CoroutineExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/CoroutineExample.cs)
- [EventExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/EventExample.cs)

…and 41 more examples in the snapshot.

<p class="api-generated" data-pagefind-ignore>Generated from the Sansar 47.10.0 client ScriptApi snapshot.</p>