pixel_tilt 
Vars | |
| last_applied_tilt_angle | The last tilt angle that was actually applied to the mob's transform. Used so we can undo only our own rotation before applying a new one, without capturing or overwriting other transform changes (such as scaling) |
|---|---|
| maximum_tilt | Maximum allowed tilt angle in either direction. Prevents excessive rotation and visual distortion. |
| tilt_angle | Current tilt angle being requested by the player (in degrees). This represents desired rotation, not necessarily what is currently applied. |
| tilt_increment | Amount of tilt (in degrees) added or removed per key press. Controls how quickly the character rotates while tilting. |
Procs | |
| apply_tilt | Applies or updates the visual tilt rotation based on player input. |
| reset_tilt_and_remove | Removes the currently applied tilt rotation from the mob's transform, then cleans up and deletes the component. |
| snap_tilt_angle | Snaps internal tilt angle values to a fixed precision. |
Var Details
last_applied_tilt_angle 
The last tilt angle that was actually applied to the mob's transform. Used so we can undo only our own rotation before applying a new one, without capturing or overwriting other transform changes (such as scaling)
maximum_tilt 
Maximum allowed tilt angle in either direction. Prevents excessive rotation and visual distortion.
tilt_angle 
Current tilt angle being requested by the player (in degrees). This represents desired rotation, not necessarily what is currently applied.
tilt_increment 
Amount of tilt (in degrees) added or removed per key press. Controls how quickly the character rotates while tilting.
Proc Details
apply_tilt
Applies or updates the visual tilt rotation based on player input.
The transform is rebuilt by first undoing the previously applied tilt before applying the new desired angle. This allows tilt to coexist safely with other transform effects such as scaling without capturing or overwriting external state.
reset_tilt_and_remove
Removes the currently applied tilt rotation from the mob's transform, then cleans up and deletes the component.
This ensures no residual rotation remains when tilt ends.
snap_tilt_angle
Snaps internal tilt angle values to a fixed precision.
Tilt angles are discrete by design, so this prevents floating-point drift from accumulating and ensures inverse rotation operations remain reliable when rebuilding transforms. Rounds by a factor of 0.01 by default.