File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ Raw input handling leads to:
29
29
## How to use
30
30
31
31
``` rust
32
+ use bevy :: {prelude :: * , input :: InputSystem };
33
+ use bevy_actify :: * ;
34
+
32
35
// 1. Define your action
33
36
#[derive(InputAction , Clone , PartialEq )]
34
37
struct Jump (f32 ); // f32 for analog sensetivity
@@ -47,6 +50,16 @@ fn character_jump(action: InputActionState<Jump>) {
47
50
// Apply force...
48
51
}
49
52
}
53
+
54
+ // 4. Register the plugin and systems
55
+ fn main () {
56
+ App :: new ()
57
+ . add_plugins (DefaultPlugins )
58
+ . add_plugins (InputActionPlugin :: <Jump >:: new ())
59
+ . add_systems (PreUpdate , keyboard_input . after (InputSystem ). before (InputActionSystem )) // properly order you systems to avoid 1 frame delay!
60
+ . add_systems (Update , character_jump )
61
+ . run ();
62
+ }
50
63
```
51
64
52
65
## How to contribute
You can’t perform that action at this time.
0 commit comments