hytopia 0.1.27 → 0.1.30
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/scripts.js +1 -0
- package/docs/server.basecharactercontroller.md +5 -5
- package/docs/server.basecharactercontroller.ontick.md +13 -0
- package/docs/server.basecharactercontroller.tick.md +53 -0
- package/docs/server.blocktype.md +2 -2
- package/docs/server.blocktype.onentitycollision.md +1 -1
- package/docs/server.blocktype.onentitycontactforce.md +1 -1
- package/docs/server.defaultcharactercontroller.canjump.md +1 -1
- package/docs/server.defaultcharactercontroller.canrun.md +1 -1
- package/docs/server.defaultcharactercontroller.canwalk.md +1 -1
- package/docs/server.defaultcharactercontroller.md +3 -17
- package/docs/server.entity.createcustomcharactercontroller.md +2 -2
- package/docs/server.entity.md +9 -9
- package/docs/server.entity.onblockcollision.md +1 -1
- package/docs/server.entity.onblockcontactforce.md +1 -1
- package/docs/server.entity.ondespawn.md +1 -1
- package/docs/server.entity.onentitycollision.md +1 -1
- package/docs/server.entity.onentitycontactforce.md +1 -1
- package/docs/server.entity.onspawn.md +1 -1
- package/docs/server.entity.ontick.md +1 -1
- package/docs/server.entityoptions.createcustomcharactercontroller.md +13 -0
- package/docs/server.entityoptions.md +19 -0
- package/docs/server.facecallback.md +15 -0
- package/docs/server.facecompletecallback.md +15 -0
- package/docs/server.faceoptions.md +18 -0
- package/docs/server.hytopia.basecharactercontroller.md +5 -5
- package/docs/server.hytopia.basecharactercontroller.ontick.md +13 -0
- package/docs/server.hytopia.basecharactercontroller.tick.md +53 -0
- package/docs/server.hytopia.blocktype.md +2 -2
- package/docs/server.hytopia.blocktype.onentitycollision.md +1 -1
- package/docs/server.hytopia.blocktype.onentitycontactforce.md +1 -1
- package/docs/server.hytopia.defaultcharactercontroller.canjump.md +1 -1
- package/docs/server.hytopia.defaultcharactercontroller.canrun.md +1 -1
- package/docs/server.hytopia.defaultcharactercontroller.canwalk.md +1 -1
- package/docs/server.hytopia.defaultcharactercontroller.md +3 -17
- package/docs/server.hytopia.entity.createcustomcharactercontroller.md +2 -2
- package/docs/server.hytopia.entity.md +9 -9
- package/docs/server.hytopia.entity.onblockcollision.md +1 -1
- package/docs/server.hytopia.entity.onblockcontactforce.md +1 -1
- package/docs/server.hytopia.entity.ondespawn.md +1 -1
- package/docs/server.hytopia.entity.onentitycollision.md +1 -1
- package/docs/server.hytopia.entity.onentitycontactforce.md +1 -1
- package/docs/server.hytopia.entity.onspawn.md +1 -1
- package/docs/server.hytopia.entity.ontick.md +1 -1
- package/docs/server.hytopia.entityoptions.createcustomcharactercontroller.md +13 -0
- package/docs/server.hytopia.entityoptions.md +19 -0
- package/docs/server.hytopia.facecallback.md +15 -0
- package/docs/server.hytopia.facecompletecallback.md +15 -0
- package/docs/server.hytopia.faceoptions.md +18 -0
- package/docs/server.hytopia.md +77 -0
- package/docs/server.hytopia.movecallback.md +15 -0
- package/docs/server.hytopia.movecompletecallback.md +15 -0
- package/docs/server.hytopia.moveoptions.md +23 -0
- package/docs/server.hytopia.simplecharactercontroller.face.md +89 -0
- package/docs/server.hytopia.simplecharactercontroller.md +88 -0
- package/docs/server.hytopia.simplecharactercontroller.move.md +89 -0
- package/docs/server.md +77 -0
- package/docs/server.movecallback.md +15 -0
- package/docs/server.movecompletecallback.md +15 -0
- package/docs/server.moveoptions.md +23 -0
- package/docs/server.simplecharactercontroller.face.md +89 -0
- package/docs/server.simplecharactercontroller.md +88 -0
- package/docs/server.simplecharactercontroller.move.md +89 -0
- package/examples/entity-spawn/index.ts +1 -1
- package/examples/payload-game/index.ts +46 -104
- package/package.json +1 -1
- package/server.api.json +1048 -264
- package/server.d.ts +191 -51
- package/server.js +57 -57
- package/tsconfig.json +4 -1
- package/docs/server.basecharactercontroller.ontickpathfindingmovement.md +0 -13
- package/docs/server.basecharactercontroller.tickpathfindingmovement.md +0 -69
- package/docs/server.defaultcharactercontroller.tickpathfindingmovement.md +0 -69
- package/docs/server.hytopia.basecharactercontroller.ontickpathfindingmovement.md +0 -13
- package/docs/server.hytopia.basecharactercontroller.tickpathfindingmovement.md +0 -69
- package/docs/server.hytopia.defaultcharactercontroller.tickpathfindingmovement.md +0 -69
- package/examples/character-controller/tsconfig.json +0 -27
- package/examples/entity-spawn/tsconfig.json +0 -27
- package/examples/payload-game/tsconfig.json +0 -27
package/bin/scripts.js
CHANGED
@@ -51,6 +51,7 @@ const path = require('path');
|
|
51
51
|
// Done, lfg!
|
52
52
|
console.log('🚀 Hytopia project initialized successfully!');
|
53
53
|
console.log('💡 Start your development server with `bun --watch index.ts`!');
|
54
|
+
console.log('🎮 After you start your development server, play by opening your browser and visiting: https://play.hytopia.com/?join=localhost:8080')
|
54
55
|
return;
|
55
56
|
}
|
56
57
|
|
@@ -96,7 +96,7 @@ The entity the controller is for.
|
|
96
96
|
</td></tr>
|
97
97
|
<tr><td>
|
98
98
|
|
99
|
-
[
|
99
|
+
[onTick?](./server.basecharactercontroller.ontick.md)
|
100
100
|
|
101
101
|
|
102
102
|
</td><td>
|
@@ -104,12 +104,12 @@ The entity the controller is for.
|
|
104
104
|
|
105
105
|
</td><td>
|
106
106
|
|
107
|
-
(
|
107
|
+
(deltaTimeMs: number) => void
|
108
108
|
|
109
109
|
|
110
110
|
</td><td>
|
111
111
|
|
112
|
-
_(Optional)_ A callback function for when the controller ticks
|
112
|
+
_(Optional)_ A callback function for when the controller ticks.
|
113
113
|
|
114
114
|
|
115
115
|
</td></tr>
|
@@ -168,7 +168,7 @@ Override this method to create sensor colliders to be attached to the controlled
|
|
168
168
|
</td></tr>
|
169
169
|
<tr><td>
|
170
170
|
|
171
|
-
[
|
171
|
+
[tick(deltaTimeMs)](./server.basecharactercontroller.tick.md)
|
172
172
|
|
173
173
|
|
174
174
|
</td><td>
|
@@ -176,7 +176,7 @@ Override this method to create sensor colliders to be attached to the controlled
|
|
176
176
|
|
177
177
|
</td><td>
|
178
178
|
|
179
|
-
Override this method to
|
179
|
+
Override this method to handle entity movements based on your character controller.
|
180
180
|
|
181
181
|
|
182
182
|
</td></tr>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [BaseCharacterController](./server.basecharactercontroller.md) > [onTick](./server.basecharactercontroller.ontick.md)
|
4
|
+
|
5
|
+
## BaseCharacterController.onTick property
|
6
|
+
|
7
|
+
A callback function for when the controller ticks.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
onTick?: (deltaTimeMs: number) => void;
|
13
|
+
```
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [BaseCharacterController](./server.basecharactercontroller.md) > [tick](./server.basecharactercontroller.tick.md)
|
4
|
+
|
5
|
+
## BaseCharacterController.tick() method
|
6
|
+
|
7
|
+
Override this method to handle entity movements based on your character controller.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
tick(deltaTimeMs: number): void;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
deltaTimeMs
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
number
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
The delta time in milliseconds since the last tick.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
</tbody></table>
|
50
|
+
**Returns:**
|
51
|
+
|
52
|
+
void
|
53
|
+
|
package/docs/server.blocktype.md
CHANGED
@@ -183,7 +183,7 @@ The name of the block type.
|
|
183
183
|
|
184
184
|
</td><td>
|
185
185
|
|
186
|
-
(
|
186
|
+
(blockType: [BlockType](./server.blocktype.md)<!-- -->, entity: [Entity](./server.entity.md)<!-- -->, started: boolean) => void
|
187
187
|
|
188
188
|
|
189
189
|
</td><td>
|
@@ -202,7 +202,7 @@ _(Optional)_ A callback function that is invoked when an entity collides with bl
|
|
202
202
|
|
203
203
|
</td><td>
|
204
204
|
|
205
|
-
(
|
205
|
+
(blockType: [BlockType](./server.blocktype.md)<!-- -->, entity: [Entity](./server.entity.md)<!-- -->, contactForceData: ContactForceData) => void
|
206
206
|
|
207
207
|
|
208
208
|
</td><td>
|
@@ -9,5 +9,5 @@ A callback function that is invoked when an entity collides with blocks of this
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
onEntityCollision?: (
|
12
|
+
onEntityCollision?: (blockType: BlockType, entity: Entity, started: boolean) => void;
|
13
13
|
```
|
@@ -9,5 +9,5 @@ A callback function that is invoked when an entity contacts a block of this type
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
onEntityContactForce?: (
|
12
|
+
onEntityContactForce?: (blockType: BlockType, entity: Entity, contactForceData: ContactForceData) => void;
|
13
13
|
```
|
@@ -101,7 +101,7 @@ Description
|
|
101
101
|
|
102
102
|
</td><td>
|
103
103
|
|
104
|
-
(
|
104
|
+
(defaultCharacterController: [DefaultCharacterController](./server.defaultcharactercontroller.md)<!-- -->) => boolean
|
105
105
|
|
106
106
|
|
107
107
|
</td><td>
|
@@ -120,7 +120,7 @@ A function allowing custom logic to determine if the entity can jump.
|
|
120
120
|
|
121
121
|
</td><td>
|
122
122
|
|
123
|
-
(
|
123
|
+
(defaultCharacterController: [DefaultCharacterController](./server.defaultcharactercontroller.md)<!-- -->) => boolean
|
124
124
|
|
125
125
|
|
126
126
|
</td><td>
|
@@ -139,7 +139,7 @@ A function allowing custom logic to determine if the entity can run.
|
|
139
139
|
|
140
140
|
</td><td>
|
141
141
|
|
142
|
-
(
|
142
|
+
(defaultCharacterController: [DefaultCharacterController](./server.defaultcharactercontroller.md)<!-- -->) => boolean
|
143
143
|
|
144
144
|
|
145
145
|
</td><td>
|
@@ -301,20 +301,6 @@ Description
|
|
301
301
|
Creates the sensor colliders for the character controller, overriding the default implementation.
|
302
302
|
|
303
303
|
|
304
|
-
</td></tr>
|
305
|
-
<tr><td>
|
306
|
-
|
307
|
-
[tickPathfindingMovement(destination, deltaTimeMs)](./server.defaultcharactercontroller.tickpathfindingmovement.md)
|
308
|
-
|
309
|
-
|
310
|
-
</td><td>
|
311
|
-
|
312
|
-
|
313
|
-
</td><td>
|
314
|
-
|
315
|
-
Ticks the pathfinding movement for the character controller, overriding the default implementation.
|
316
|
-
|
317
|
-
|
318
304
|
</td></tr>
|
319
305
|
<tr><td>
|
320
306
|
|
@@ -4,10 +4,10 @@
|
|
4
4
|
|
5
5
|
## Entity.createCustomCharacterController property
|
6
6
|
|
7
|
-
A function that creates a custom character controller for the entity.
|
7
|
+
A function that creates a custom character controller for the entity when it spawns.
|
8
8
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
createCustomCharacterController?: (
|
12
|
+
createCustomCharacterController?: (entity: Entity) => BaseCharacterController;
|
13
13
|
```
|
package/docs/server.entity.md
CHANGED
@@ -133,12 +133,12 @@ The character controller for the entity.
|
|
133
133
|
|
134
134
|
</td><td>
|
135
135
|
|
136
|
-
(
|
136
|
+
(entity: [Entity](./server.entity.md)<!-- -->) => [BaseCharacterController](./server.basecharactercontroller.md)
|
137
137
|
|
138
138
|
|
139
139
|
</td><td>
|
140
140
|
|
141
|
-
_(Optional)_ A function that creates a custom character controller for the entity.
|
141
|
+
_(Optional)_ A function that creates a custom character controller for the entity when it spawns.
|
142
142
|
|
143
143
|
|
144
144
|
</td></tr>
|
@@ -278,7 +278,7 @@ The name of the entity.
|
|
278
278
|
|
279
279
|
</td><td>
|
280
280
|
|
281
|
-
(
|
281
|
+
(entity: [Entity](./server.entity.md)<!-- -->, block: [BlockType](./server.blocktype.md)<!-- -->, started: boolean) => void
|
282
282
|
|
283
283
|
|
284
284
|
</td><td>
|
@@ -297,7 +297,7 @@ _(Optional)_ A function that is called when the entity collides with a block.
|
|
297
297
|
|
298
298
|
</td><td>
|
299
299
|
|
300
|
-
(
|
300
|
+
(entity: [Entity](./server.entity.md)<!-- -->, block: [BlockType](./server.blocktype.md)<!-- -->, contactForceData: ContactForceData) => void
|
301
301
|
|
302
302
|
|
303
303
|
</td><td>
|
@@ -316,7 +316,7 @@ _(Optional)_ A function that is called when the entity collides with a block.
|
|
316
316
|
|
317
317
|
</td><td>
|
318
318
|
|
319
|
-
(
|
319
|
+
(entity: [Entity](./server.entity.md)<!-- -->) => void
|
320
320
|
|
321
321
|
|
322
322
|
</td><td>
|
@@ -335,7 +335,7 @@ _(Optional)_ A function that is called when the entity is despawned.
|
|
335
335
|
|
336
336
|
</td><td>
|
337
337
|
|
338
|
-
(
|
338
|
+
(entity: [Entity](./server.entity.md)<!-- -->, otherEntity: [Entity](./server.entity.md)<!-- -->, started: boolean) => void
|
339
339
|
|
340
340
|
|
341
341
|
</td><td>
|
@@ -354,7 +354,7 @@ _(Optional)_ A function that is called when the entity collides with another ent
|
|
354
354
|
|
355
355
|
</td><td>
|
356
356
|
|
357
|
-
(
|
357
|
+
(entity: [Entity](./server.entity.md)<!-- -->, otherEntity: [Entity](./server.entity.md)<!-- -->, contactForceData: ContactForceData) => void
|
358
358
|
|
359
359
|
|
360
360
|
</td><td>
|
@@ -373,7 +373,7 @@ _(Optional)_ A function that is called when the entity contacts another entity.
|
|
373
373
|
|
374
374
|
</td><td>
|
375
375
|
|
376
|
-
(
|
376
|
+
(entity: [Entity](./server.entity.md)<!-- -->) => void
|
377
377
|
|
378
378
|
|
379
379
|
</td><td>
|
@@ -392,7 +392,7 @@ _(Optional)_ A function that is called when the entity is spawned.
|
|
392
392
|
|
393
393
|
</td><td>
|
394
394
|
|
395
|
-
(
|
395
|
+
(entity: [Entity](./server.entity.md)<!-- -->, tickDeltaMs: number) => void
|
396
396
|
|
397
397
|
|
398
398
|
</td><td>
|
@@ -9,5 +9,5 @@ A function that is called when the entity collides with a block.
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
onBlockCollision?: (
|
12
|
+
onBlockCollision?: (entity: Entity, block: BlockType, started: boolean) => void;
|
13
13
|
```
|
@@ -9,5 +9,5 @@ A function that is called when the entity collides with a block.
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
onBlockContactForce?: (
|
12
|
+
onBlockContactForce?: (entity: Entity, block: BlockType, contactForceData: ContactForceData) => void;
|
13
13
|
```
|
@@ -9,5 +9,5 @@ A function that is called when the entity collides with another entity.
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
onEntityCollision?: (
|
12
|
+
onEntityCollision?: (entity: Entity, otherEntity: Entity, started: boolean) => void;
|
13
13
|
```
|
@@ -9,5 +9,5 @@ A function that is called when the entity contacts another entity.
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
onEntityContactForce?: (
|
12
|
+
onEntityContactForce?: (entity: Entity, otherEntity: Entity, contactForceData: ContactForceData) => void;
|
13
13
|
```
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [EntityOptions](./server.entityoptions.md) > [createCustomCharacterController](./server.entityoptions.createcustomcharactercontroller.md)
|
4
|
+
|
5
|
+
## EntityOptions.createCustomCharacterController property
|
6
|
+
|
7
|
+
A function that creates a custom character controller for the entity when it spawns.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
createCustomCharacterController?: (entity: Entity) => BaseCharacterController;
|
13
|
+
```
|
@@ -37,6 +37,25 @@ Description
|
|
37
37
|
</th></tr></thead>
|
38
38
|
<tbody><tr><td>
|
39
39
|
|
40
|
+
[createCustomCharacterController?](./server.entityoptions.createcustomcharactercontroller.md)
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
|
46
|
+
</td><td>
|
47
|
+
|
48
|
+
(entity: [Entity](./server.entity.md)<!-- -->) => [BaseCharacterController](./server.basecharactercontroller.md)
|
49
|
+
|
50
|
+
|
51
|
+
</td><td>
|
52
|
+
|
53
|
+
_(Optional)_ A function that creates a custom character controller for the entity when it spawns.
|
54
|
+
|
55
|
+
|
56
|
+
</td></tr>
|
57
|
+
<tr><td>
|
58
|
+
|
40
59
|
[modelLoopedAnimations?](./server.entityoptions.modelloopedanimations.md)
|
41
60
|
|
42
61
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [FaceCallback](./server.facecallback.md)
|
4
|
+
|
5
|
+
## FaceCallback type
|
6
|
+
|
7
|
+
A callback function called when the entity associated with the SimpleCharacterController updates its rotation as it is attempting to face a target coordinate.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export type FaceCallback = (currentRotation: Rotation, targetRotation: Rotation) => void;
|
13
|
+
```
|
14
|
+
**References:** [Rotation](./server.rotation.md)
|
15
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [FaceCompleteCallback](./server.facecompletecallback.md)
|
4
|
+
|
5
|
+
## FaceCompleteCallback type
|
6
|
+
|
7
|
+
A callback function called when the entity associated with the SimpleCharacterController finishes rotating and is now facing a target coordinate.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export type FaceCompleteCallback = (endRotation: Rotation) => void;
|
13
|
+
```
|
14
|
+
**References:** [Rotation](./server.rotation.md)
|
15
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [FaceOptions](./server.faceoptions.md)
|
4
|
+
|
5
|
+
## FaceOptions type
|
6
|
+
|
7
|
+
Options for the [SimpleCharacterController.face()](./server.simplecharactercontroller.face.md) method.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export type FaceOptions = {
|
13
|
+
faceCallback?: FaceCallback;
|
14
|
+
faceCompleteCallback?: FaceCompleteCallback;
|
15
|
+
};
|
16
|
+
```
|
17
|
+
**References:** [FaceCallback](./server.facecallback.md)<!-- -->, [FaceCompleteCallback](./server.facecompletecallback.md)
|
18
|
+
|
@@ -96,7 +96,7 @@ The entity the controller is for.
|
|
96
96
|
</td></tr>
|
97
97
|
<tr><td>
|
98
98
|
|
99
|
-
[
|
99
|
+
[onTick?](./server.hytopia.basecharactercontroller.ontick.md)
|
100
100
|
|
101
101
|
|
102
102
|
</td><td>
|
@@ -104,12 +104,12 @@ The entity the controller is for.
|
|
104
104
|
|
105
105
|
</td><td>
|
106
106
|
|
107
|
-
(
|
107
|
+
(deltaTimeMs: number) => void
|
108
108
|
|
109
109
|
|
110
110
|
</td><td>
|
111
111
|
|
112
|
-
_(Optional)_ A callback function for when the controller ticks
|
112
|
+
_(Optional)_ A callback function for when the controller ticks.
|
113
113
|
|
114
114
|
|
115
115
|
</td></tr>
|
@@ -168,7 +168,7 @@ Override this method to create sensor colliders to be attached to the controlled
|
|
168
168
|
</td></tr>
|
169
169
|
<tr><td>
|
170
170
|
|
171
|
-
[
|
171
|
+
[tick(deltaTimeMs)](./server.hytopia.basecharactercontroller.tick.md)
|
172
172
|
|
173
173
|
|
174
174
|
</td><td>
|
@@ -176,7 +176,7 @@ Override this method to create sensor colliders to be attached to the controlled
|
|
176
176
|
|
177
177
|
</td><td>
|
178
178
|
|
179
|
-
Override this method to
|
179
|
+
Override this method to handle entity movements based on your character controller.
|
180
180
|
|
181
181
|
|
182
182
|
</td></tr>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [BaseCharacterController](./server.hytopia.basecharactercontroller.md) > [onTick](./server.hytopia.basecharactercontroller.ontick.md)
|
4
|
+
|
5
|
+
## HYTOPIA.BaseCharacterController.onTick property
|
6
|
+
|
7
|
+
A callback function for when the controller ticks.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
onTick?: (deltaTimeMs: number) => void;
|
13
|
+
```
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [BaseCharacterController](./server.hytopia.basecharactercontroller.md) > [tick](./server.hytopia.basecharactercontroller.tick.md)
|
4
|
+
|
5
|
+
## HYTOPIA.BaseCharacterController.tick() method
|
6
|
+
|
7
|
+
Override this method to handle entity movements based on your character controller.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
tick(deltaTimeMs: number): void;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
deltaTimeMs
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
number
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
The delta time in milliseconds since the last tick.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
</tbody></table>
|
50
|
+
**Returns:**
|
51
|
+
|
52
|
+
void
|
53
|
+
|
@@ -183,7 +183,7 @@ The name of the block type.
|
|
183
183
|
|
184
184
|
</td><td>
|
185
185
|
|
186
|
-
(
|
186
|
+
(blockType: [BlockType](./server.blocktype.md)<!-- -->, entity: [Entity](./server.entity.md)<!-- -->, started: boolean) => void
|
187
187
|
|
188
188
|
|
189
189
|
</td><td>
|
@@ -202,7 +202,7 @@ _(Optional)_ A callback function that is invoked when an entity collides with bl
|
|
202
202
|
|
203
203
|
</td><td>
|
204
204
|
|
205
|
-
(
|
205
|
+
(blockType: [BlockType](./server.blocktype.md)<!-- -->, entity: [Entity](./server.entity.md)<!-- -->, contactForceData: ContactForceData) => void
|
206
206
|
|
207
207
|
|
208
208
|
</td><td>
|
@@ -9,5 +9,5 @@ A callback function that is invoked when an entity collides with blocks of this
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
onEntityCollision?: (
|
12
|
+
onEntityCollision?: (blockType: BlockType, entity: Entity, started: boolean) => void;
|
13
13
|
```
|
@@ -9,5 +9,5 @@ A callback function that is invoked when an entity contacts a block of this type
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
onEntityContactForce?: (
|
12
|
+
onEntityContactForce?: (blockType: BlockType, entity: Entity, contactForceData: ContactForceData) => void;
|
13
13
|
```
|