<!-- Page: https://rustic-game-engine.pages.dev/docs/api/entity/entity-id -->

# rustic.entity_id()

[Entity & time](https://rustic-game-engine.pages.dev/markdown/api/entity.md)

## Compatibility

**Supported languages:** C, C++, C#, Python, JavaScript, Lua 5.4, Luau, Java, PHP and HTML/inline JavaScript (binding spellings and return shapes differ).

Use a compatible native engine build and the language tools required by your binding. This does not establish browser/mobile export or release qualification for every OS.

The signature below is the shared reference notation; language examples show the actual binding syntax. Question marks mark optional arguments and explicit defaults are shown where recorded. Do not copy reference notation as a typed declaration.

See [Feature status and compatibility](https://rustic-game-engine.pages.dev/markdown/reference/compatibility.md) for API 1.0/1.1 and per-method restrictions. Engine release tags and Docs v0.1 are independent versions.

## Signature

`rustic.entity_id()`

## Setup and usage

Read the entity ID when another system needs a stable reference to this owner. Use `delta_time` with `Update` for frame-rate-independent presentation and `fixed_delta_time` with `FixedUpdate` for simulation.

## Parameters

This call has no arguments.

## Return and timing

The ID is a stable string. Time values are finite seconds.

## Execution behavior

Core write timing differs between immediate Lua host calls, deferred JavaScript/Web commands and external SDK query flushes. Scheduled actions advance with the scene clock; synchronous queries evaluate at the call. Follow [execution rules](https://rustic-game-engine.pages.dev/markdown/guides/scripting.md#when-mutations-take-effect) and the return/timing notes for this category.

## Language examples

Use these snippets inside Start/on_start after generating the Programming Workspace and attaching the script. Python imports rustic, Game and instance from rustic; C++ includes rustic.hpp; C includes rustic.h; C# uses using static Rustic; Java runs inside a Rustic subclass; PHP declares global $rustic, $Game, $instance in its callback. HTML uses an inline script in a ui/ asset. See [Lifecycle callbacks](https://rustic-game-engine.pages.dev/markdown/callbacks.md) for complete registration examples. Public-property examples require a declared integer health property. Scene examples require the named objects to exist before Play.

### Lua 5.4

```lua
local id = rustic.entity_id()
local dt = rustic.delta_time()
local fixedDt = rustic.fixed_delta_time()
```

### JavaScript

```javascript
const id = rustic.entity_id();
const dt = rustic.delta_time();
const fixedDt = rustic.fixed_delta_time();
```

### Python

```python
entity_id = rustic.entity_id()
dt = rustic.delta_time()
fixed_dt = rustic.fixed_delta_time()
```

### C++

```cpp
std::string id = rustic.entity_id();
double dt = rustic.delta_time();
double fixedDt = rustic.fixed_delta_time();
```

### C#

```csharp
string id = rustic.entity_id();
double dt = rustic.delta_time();
double fixedDt = rustic.fixed_delta_time();
```

### Luau

```lua
local id = rustic.entity_id()
local dt = rustic.delta_time()
local fixedDt = rustic.fixed_delta_time()
```

### C

```c
const char *id = rustic.entity_id();
double dt = rustic.delta_time();
double fixedDt = rustic.fixed_delta_time();
```

### Java

```java
String id = rustic.entity_id();
double dt = rustic.delta_time();
double fixedDt = rustic.fixed_delta_time();
```

### PHP

```php
$id = $rustic->entity_id();
$dt = $rustic->delta_time();
$fixedDt = $rustic->fixed_delta_time();
```

### HTML / inline JS

```javascript
const id = rustic.entity_id();
const dt = rustic.delta_time();
const fixedDt = rustic.fixed_delta_time();
```

## Shared Entity & time constraints

- Every gameplay language calls the engine-owned API. Rustic supplies SDKs and dispatches callbacks; scripts do not parse requests or serialize responses. See the language guide for complete setup and callback registration.

## Errors and debugging

Read the constraints above and the Console diagnostic. Invalid types, non-finite values, stale targets or unavailable native services can fail validation. A failed callback disables the behavior; a failed source reload keeps the last good instance. Exact error messages depend on the language adapter. See [Troubleshooting](https://rustic-game-engine.pages.dev/markdown/troubleshooting.md).

## Related APIs

- [rustic.delta_time()](https://rustic-game-engine.pages.dev/markdown/api/entity/delta-time.md)
- [rustic.fixed_delta_time()](https://rustic-game-engine.pages.dev/markdown/api/entity/fixed-delta-time.md)

[All entity APIs](https://rustic-game-engine.pages.dev/markdown/api/entity.md)
