The Gravity Field is an environmental mechanic that locks the character’s gravity, either facing upward or downward. While in the gravity field, the character will not be able to use their reverse gravity ability. The character must have the reverse gravity ability component to be affected by gravity fields, but they don’t need to have a key bound to it.
Example Usage
No scene solely used for the gravity field exists, but you can see it in action in the Reverse Gravity Whitebox
Setup
Download all the mechanics on the Getting Started page
Quick Setup
-
- Drag the prefab (located in Prefabs/EnvironmentalMechanics) into your unity scene and you’re set!
Manual Setup
-
- Drag the script GravityField.cs (located in Scripts/EnvironmentalMechanics) onto a collider in your scene.
- Make sure your collider has IsTrigger set to true, so the player can walk into it.
- Set the gravity direction for the field in the inspector properties.
Customization
Properties
-
-
- Gravity Direction – The direction the field will pull the character.
-
Events
-
-
- EnteredField – Fires when a character enters this field
- ExitedField – Fires when a character exits this field
-
Caveats/Bugs
- No known issues at this time. Feel free to report bugs!