# ObjectPublic

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.ObjectPublic"></span>

The ObjectPublic class is a more limited subset of the [`ObjectPrivate`](/scripting/api/sansar.simulation/objectprivate) API for use by other scripts in the scene.

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

## Remarks

[`ObjectPrivate`](/scripting/api/sansar.simulation/objectprivate) has wider access than ObjectPublic. Objects may be removed from the scene at any time. Attempting to use an ObjectPublic interface for an object no longer in the scene will throw a NullReferenceException.

## Members at a glance

| Kind | Members |
|---|---|
| **Properties** | [ForwardVector](#forwardvector) · [InitialPosition](#initialposition) · [InitialRotation](#initialrotation) · [Name](#name) · [ObjectId](#objectid) · [Position](#position) · [RightVector](#rightvector) · [Rotation](#rotation) · [UpVector](#upvector) |
| **Methods** | [ToString](#tostring) |

## Properties

### ForwardVector

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

```csharp signature
public Sansar.Vector ForwardVector { get; }
```

The forward vector of the ObjectPublic in the world frame.

**Value:** [Sansar.Vector](/scripting/api/sansar/vector) — A normalized vector.

</div>

### InitialPosition

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

```csharp signature
public Sansar.Vector InitialPosition { get; }
```

The position of the ObjectPublic in world frame before simulation started.

</div>

### InitialRotation

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

```csharp signature
public Sansar.Quaternion InitialRotation { get; }
```

The rotation of the ObjectPublic in world frame before simulation started.

</div>

### Name

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

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

This ObjectPublic name, as specified in the editor.

</div>

### ObjectId

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

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

This ObjectPublic Id. Unique to this Scene.

</div>

### Position

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

```csharp signature
public Sansar.Vector Position { get; }
```

The current position of the ObjectPublic in world frame.

</div>

### RightVector

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

```csharp signature
public Sansar.Vector RightVector { get; }
```

The right vector of the ObjectPublic in the world frame.

**Value:** [Sansar.Vector](/scripting/api/sansar/vector) — A normalized vector.

</div>

### Rotation

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

```csharp signature
public Sansar.Quaternion Rotation { get; }
```

The current rotation of the ObjectPublic in the world frame.

</div>

### UpVector

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

```csharp signature
public Sansar.Vector UpVector { get; }
```

The up vector of the ObjectPublic in the world frame.

**Value:** [Sansar.Vector](/scripting/api/sansar/vector) — A normalized vector.

</div>


## Methods

### ToString

<div class="api-card">
<span id="M:Sansar.Simulation.ObjectPublic.ToString"></span>
<span id="M:Sansar.Simulation.ObjectPublic.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>




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