You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+60-9Lines changed: 60 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -20,26 +20,77 @@ More info in this blog post: https://www.projectborealis.com/movement.
20
20
21
21
## Binaries
22
22
23
-
Binaries are compiled for `4.27`, and will work on C++ projects.
23
+
Binaries are compiled for `5.5`, and will work on C++ projects.
24
24
25
25
If you have a Blueprint project, you must upgrade to a C++ project, or else the game will fail to package.
26
26
27
-
If you are using a different version of Unreal Engine, you will need to recompile the plugin.
28
-
29
-
## Redistribution note
30
-
31
-
Our ladder movement code and sprinting speed logic is game specific and is not publicly redistributed at this time.
27
+
If you are using a different version of Unreal Engine, you will need to recompile the plugin. Versions prior to `5.5` may require additional code changes. We are happy to accept PRs to improve the compatibility of the plugin.
32
28
33
29
# Instructions
34
30
35
-
1.Paste the [PBCharacterMovement folder](https://github.com/ProjectBorealis/PBCharacterMovement/archive/master.zip) into your project's `Plugins/` folder.
31
+
1.[Download the PBCharacterMovement plugin](https://github.com/ProjectBorealis/PBCharacterMovement/archive/main.zip) and paste it into your project's `Plugins/` folder.
36
32
2. Open your Unreal Engine project.
37
-
3. Add Enhanced Input actions and mappings for forward, right, look up, turn, jump, and crouch.
38
-
4. Create a new player controller in Blueprint or C++. Here's a [simple Blueprint example](https://blueprintue.com/blueprint/l7vxktwk/). Please note this example binds to the legacy input system, but Enhanced Input should similarly bind to the same functions.
33
+
3. Add Enhanced Input actions and mappings for forward, right, look up, turn, jump, and crouch. Setting these assets up properly is not covered here, but many tutorials for this exist online.
34
+
4. Create a new player controller in Blueprint or C++. Here's a [simple Blueprint example](https://blueprintue.com/blueprint/mhk2sgn9/).
39
35
5. Create a Blueprint child class of PBPlayerCharacter.
40
36
6. Create a gamemode with Default Pawn set to your Blueprint character class, and Player Controller set to your player controller.
41
37
7. Enjoy the movement!
42
38
39
+
## Gravity
40
+
43
41
You may also want to use HL2 gravity settings. Go to Settings > Project Settings > Engine > Physics > Constants > Default Gravity Z and set it to `-1143`.
44
42
43
+
The player movement will automatically adjust its own gravity scale to account for any differences between the gravity Z in your project and HL2, so
44
+
it's fine if you want a different gravity for your physics objects, and retain HL2 player gravity for fall speeds and jump heights. However, if you want
45
+
to fully use your own gravity instead of HL2 gravity, you can define `USE_HL2_GRAVITY=0`
46
+
47
+
## Physics materials
48
+
45
49
Additionally, your default physics material should have a friction of `0.8` and restitution of `0.25` if you want Source defaults.
50
+
51
+
You can put this in your `Config/DefaultEngine.ini` file to do so:
52
+
53
+
```ini
54
+
[SystemSettings]
55
+
p.DefaultCollisionFriction=0.8
56
+
p.DefaultCollisionRestitution=0.25
57
+
```
58
+
59
+
## Move Speeds and Ladder
60
+
61
+
Our ladder movement code and sprinting speed logic is game specific and is not publicly redistributed at this time. However, we do have stubs for you to insert your own logic here.
62
+
63
+
You can call `SetSprinting` and `SetWantsToWalk` for sprint and walk speed respectively. You can set `SprintSpeed`, `WalkSpeed` to set speeds for those modes, and set `RunSpeed` for the default speed.
64
+
65
+
Ladder movement code is a bit less complete due to reliance on ladder entity data to determine various aspects of the movement like direction and state. Integrating your own ladder code is outside
66
+
the scope of this document, and is left as an exercise for the reader.
67
+
68
+
## Jump Boosting
69
+
70
+
"Jump boosting", a feature of HL2 that causes the player to get a velocity boost when jumping. This also
71
+
causes the accelerated back hopping (ABH) bug which allows players to rapidly move around the map. You can control this feature using the `move.JumpBoost` cvar. `0` will entirely remove this feature, resulting in no velocity boost. `1` is HL2 functionality, with the ABH bug. `2` is HL2 functionality, patched to prevent such exploits. You may want to use `0` or `2` for a multiplayer game.
72
+
73
+
## Forward bunnyhopping
74
+
75
+
An older version of HL2 had a bug where the jump boosting feature had no speed limit, and players could repeatedly jump to get successively speed boosts with no special movement like ABH requires. You can enable
76
+
the feature from the older engine of HL2 by setting `move.Bunnyhopping 1`.
77
+
78
+
## First person mesh support
79
+
80
+
Unreal Engine's character movement component assumes the character's mesh is a third person mesh that is grounded within the world. This affects how it is positioned when crouch hitboxes change, and some other effects.
81
+
82
+
Therefore, to assist in implementing first-person games and reduce confusion, we have provided a Mesh1P component you can use for FPS meshes for the player's perspective. You will need to implement your own
83
+
game-specific positioning system though, and respond to crouch eye height changes. We recommend to do this on camera update. If you need an example, please refer to the old `ShooterGame` example project from Epic. If you do not want or need this functionality, define `USE_FIRST_PERSON=0`.
84
+
85
+
## Always apply friction
86
+
87
+
HL2 movement uses friction to bring the player down to the speed cap. In air, this is not
88
+
applied by default. If you would like to limit the player's air speed, set `move.AlwaysApplyFriction 1`.
89
+
90
+
## Crouch sliding
91
+
92
+
Experimental support for crouch sliding is provided by defining `USE_CROUCH_SLIDING=1`. However, some gameplay effects, like camera shakes, sounds, etc have been stripped due to dependencies on some internal gameplay systems. You can implement this for your own game if wanted.
93
+
94
+
## Directional braking
95
+
96
+
HL2 movement only applies braking friction in oppposition to the player's full movement. This may be too slippery when strafing or tapping keys for some games, these games can use directional braking which brakes each direction (forward/back and left/right) independently, allowing for each directional to be opposed by friction with full force. Enable this by defining `DIRECTIONAL_BRAKING=1`.
0 commit comments