Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
astrochili committed Jun 10, 2023
1 parent d4b8d43 commit cb7641b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,36 @@ Ready to use with [🎥 Operator](https://github.com/astrochili/defold-operator/

Add link to the zip-archive of the latest version of [defold-kinematic-walker](https://github.com/astrochili/defold-kinematic-walker/releases) to your Defold project as [dependency](http://www.defold.com/manuals/libraries/).

## Project Settings

The following settings in the `game.project` file are recommended for the walker to work correctly:

```ini
[physics]
type = 3D
use_fixed_timestep = 1
max_fixed_timesteps = 1

[display]
update_frequency = 60

[engine]
fixed_update_frequency = 60
```

## Quick Start

1. Add the `collision_standing` collision object with the capsule shape to your character's gameobject. The position anchor must be on the floor. Set type to `Kinematic` and switch locked rotation to `true`.
Add the `dummy.collection` collection to your scene. It's already composed collection of the player with capsule collision objects and models to test hypotheses and adjust things for your needs.

Make sure you set up the camera correctly or connect [Operator](#operator). The `dummy.script` can integrate it automatically, so just fill in the url in the `operator` property.

## Advanced Start

### Minimal setup

1. Add a gameobject `body` to your character's gamoobject and attach the `body.script` component to it.

2. Add the `collision_standing` collision object with the capsule shape to the `body` gameobject. Set type to `Kinematic` and switch locked rotation to `true`. The position anchor must be on the floor.

2. Add `walker.script` to your character's gameobject and configure its script properties in the editor.

Expand Down
10 changes: 10 additions & 0 deletions walker/dummy/dummy.collection
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ embedded_instances {
" value: \"dummy\"\n"
" type: PROPERTY_TYPE_URL\n"
" }\n"
" properties {\n"
" id: \"is_crouching_allowed\"\n"
" value: \"true\"\n"
" type: PROPERTY_TYPE_BOOLEAN\n"
" }\n"
" properties {\n"
" id: \"eyes_switching\"\n"
" value: \"true\"\n"
" type: PROPERTY_TYPE_BOOLEAN\n"
" }\n"
" property_decls {\n"
" }\n"
"}\n"
Expand Down
4 changes: 2 additions & 2 deletions walker/walker.script
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ go.property('gravity_acceleration', 3)

go.property('sensor_length', 0.05)

go.property('is_crouching_allowed', true)
go.property('is_crouching_allowed', false)

go.property('body', msg.url('body'))
go.property('collision_standing', msg.url('body#collision_standing'))
go.property('collision_crouching', msg.url('body#collision_crouching'))

go.property('eyes_switching', true)
go.property('eyes_switching', false)
go.property('eyes', msg.url('eyes'))
go.property('eyes_switch_duration', 0.2)

Expand Down

0 comments on commit cb7641b

Please sign in to comment.