hytopia 0.1.29 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/scripts.js +1 -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 -3
- 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.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 -3
- 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.moveoptions.md +5 -0
- package/docs/server.hytopia.simplecharactercontroller.md +1 -1
- package/docs/server.moveoptions.md +5 -0
- package/docs/server.simplecharactercontroller.md +1 -1
- 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 +142 -60
- package/server.d.ts +51 -33
- package/server.js +25 -25
- package/tsconfig.json +4 -1
- 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
|
|
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>
|
@@ -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
|
|
@@ -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>
|
@@ -4,10 +4,10 @@
|
|
4
4
|
|
5
5
|
## HYTOPIA.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
|
```
|
@@ -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) > [HYTOPIA](./server.hytopia.md) > [EntityOptions](./server.hytopia.entityoptions.md) > [createCustomCharacterController](./server.hytopia.entityoptions.createcustomcharactercontroller.md)
|
4
|
+
|
5
|
+
## HYTOPIA.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.hytopia.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.hytopia.entityoptions.modelloopedanimations.md)
|
41
60
|
|
42
61
|
|
@@ -12,6 +12,11 @@ Options for the [SimpleCharacterController.move()](./server.simplecharactercontr
|
|
12
12
|
export type MoveOptions = {
|
13
13
|
moveCallback?: MoveCallback;
|
14
14
|
moveCompleteCallback?: MoveCompleteCallback;
|
15
|
+
moveIgnoreAxes?: {
|
16
|
+
x?: boolean;
|
17
|
+
y?: boolean;
|
18
|
+
z?: boolean;
|
19
|
+
};
|
15
20
|
};
|
16
21
|
```
|
17
22
|
**References:** [MoveCallback](./server.movecallback.md)<!-- -->, [MoveCompleteCallback](./server.movecompletecallback.md)
|
@@ -15,7 +15,7 @@ export default class SimpleCharacterController extends BaseCharacterController
|
|
15
15
|
|
16
16
|
## Remarks
|
17
17
|
|
18
|
-
This class implements simple movement methods that serve as a way to add realistic movement and rotational facing functionality to an entity. This is also a great base to extend for your own more complex character controller that implements things like pathfinding.
|
18
|
+
This class implements simple movement methods that serve as a way to add realistic movement and rotational facing functionality to an entity. This is also a great base to extend for your own more complex character controller that implements things like pathfinding. Compatible with entities that have kinematic or dynamic rigid body types.
|
19
19
|
|
20
20
|
## Example
|
21
21
|
|
@@ -12,6 +12,11 @@ Options for the [SimpleCharacterController.move()](./server.simplecharactercontr
|
|
12
12
|
export type MoveOptions = {
|
13
13
|
moveCallback?: MoveCallback;
|
14
14
|
moveCompleteCallback?: MoveCompleteCallback;
|
15
|
+
moveIgnoreAxes?: {
|
16
|
+
x?: boolean;
|
17
|
+
y?: boolean;
|
18
|
+
z?: boolean;
|
19
|
+
};
|
15
20
|
};
|
16
21
|
```
|
17
22
|
**References:** [MoveCallback](./server.movecallback.md)<!-- -->, [MoveCompleteCallback](./server.movecompletecallback.md)
|
@@ -15,7 +15,7 @@ export default class SimpleCharacterController extends BaseCharacterController
|
|
15
15
|
|
16
16
|
## Remarks
|
17
17
|
|
18
|
-
This class implements simple movement methods that serve as a way to add realistic movement and rotational facing functionality to an entity. This is also a great base to extend for your own more complex character controller that implements things like pathfinding.
|
18
|
+
This class implements simple movement methods that serve as a way to add realistic movement and rotational facing functionality to an entity. This is also a great base to extend for your own more complex character controller that implements things like pathfinding. Compatible with entities that have kinematic or dynamic rigid body types.
|
19
19
|
|
20
20
|
## Example
|
21
21
|
|
@@ -56,7 +56,7 @@ startServer(world => {
|
|
56
56
|
});
|
57
57
|
|
58
58
|
// A simple collision callback that logs when the spider collides with another Entity.
|
59
|
-
spider.onEntityCollision = (otherEntity, started) => {
|
59
|
+
spider.onEntityCollision = (spider, otherEntity, started) => {
|
60
60
|
console.log('spider colliding with', otherEntity.name, started);
|
61
61
|
};
|
62
62
|
|