SecondaryMotion
A secondary motion system for BONELAB.
| Date uploaded | 2 weeks ago |
| Version | 2.1.0 |
| Download link | WeatherElectric-SecondaryMotion-2.1.0.zip |
| Downloads | 317 |
| Dependency string | WeatherElectric-SecondaryMotion-2.1.0 |
This mod requires the following mods to function
LavaGang-MelonLoader
The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono
Preferred version: 0.7.3WNP78-FieldInjector
A utility for other mods to inject monobehaviour fields into the IL2CPP domain.
Preferred version: 2.1.1README
Secondary Motion
A secondary motion system for BONELAB.
(swisches my big fluffy $$$$-ing tail) 

Unity Editor - Wiki
SDK mods using these scripts can be compiled perfectly fine!
If someone installs the SDK mod and doesn't have this code mod installed, your SDK mod will still work, just anything using Secondary Motion will not.
It will not break other parts of your SDK mod just because the code mod isn't loaded.


While it could technically be universal, FieldInjector is very specific to the Unity version that BONELAB uses, so it'd likely not work well in other games.
Dependencies
Required
Optional
The mod will still work fine if these are not installed.
Preferences
Adds 3 preferences:
- Minimum Simulation FPS
- Visibility Culling (Experimental)
- Only Simulate Local Player
MinSimFPS - Float - Default: 20
This prevents jittering on frame drops, at the cost of the simulation not being as responsive. The simulation is still responsive if you're getting good framerate! It'll just start slowing down a bit to prevent jitter if your framerate gets bad.
The format is in target FPS for capping the simulated time per frame.
This can optionally be disabled by setting the value to 0.
VisibilityCulling - Bool - Default: False - EXPERIMENTAL
Stops the simulation based on the visibility of the rig's meshes.
This is still experimental, it could cause issues.
This is in community testing phase, please report issues to me on Discord (keeplousafe) if you use it!
OnlySimulateLocalPlayer - Bool - Default: False
Only simulates bones on the local player rig, ignoring other rigs (like in Fusion)
This will only work if BoneLib is installed, but the rest of the mod works fine if BoneLib isn't installed
Isn't There Another Mod For This?
Yes! But I just personally don't like how it works.
No hate to the developers of that mod, it's not badly made, just some quirks cause it to not work how I'd want a mod like this to work. I don't think mine is inherently better, I just prefer simplicity!
This mod will still work fine alongside theirs, though! However, SecondaryMotion will take priority if it's on the same exact object as DynamicBones.
Really hoping that doesn't turn out in an Object.Destroy() war. I'm not destroying DynamicBone components everywhere!! Just only ones that are on the same exact object as SecondaryMotion to prevent double simulations.
CHANGELOG
v2.3.0
Feature Additions
- SyncUpdateRateToGameTime field, sets the component's update rate to match the update rate of the game, disregarding what the component's UpdateRate is set to.
Bug Fixes
- Better physics update rate handling, reducing jitter issues on some systems
- FixedUpdate now properly functions as it should
v2.2.0
Feature Additions
- Added a custom inspector window for SecondaryMotion.cs, making it look much nicer in editor
v2.1.0
DRAWBRIDGE
Added a gating system for game-specific code
Any code that tries to use game-specific stuff, like stuff that uses DynamicBonesBL or BoneLib for BONELAB, will only run if those mods are installed and the game running is BONELAB.
This means the mod will work just fine without having those mods installed, it just won't run its code that uses them.
Why is it named DRAWBRIDGE?
It prevents code from running if the requirements aren't met!
...and also because i've been playing a lot of death stranding 2 and drawbridge is a thing in death stranding 2.
Feature Additions
- Added the ability to only simulate the local player's bones, so Fusion players don't simulate their Secondary Motion bones, for performance (Default is off)
v2.0.2
Behaviour Changes
- "Root" field now automatically sets itself to the object you added the SecondaryMotion script to
v2.0.1
Feature Changes
- Visibility Culling now uses camera frustrums from the main player camera, hopefully preventing issues in Fusion. Feature remains experimental.
v2.0.0
BREAKING CHANGES
Gravity calculations have been redone, so old values may seem way too low. -9.81 is now the baseline value for standard gravity! "Enable Gravity" was also added, which is false by default, so mods using the old versions will lose gravity entirey.
The issues this specifically fixes are:
- Gravity is now world space
- Gravity is no longer applying too little force
Bug Fixes
- Fixed MaxAngle not working if Elasticity is 0
v1.2.0
Feature Additions
- Added Visibility Culling (EXPERIMENTAL)
- Added HelpURLs to the editor scripts
v1.1.0
Feature Additions
- Added MaxAngle and MaxAngleCurve fields
v1.0.2
Bug Fixes
- Fixed bone rotations in mirrors
- Fixed jitter issues on frame drops
v1.0.1
Package Changes
- Redid icon and README a bit
Bug Fixes
- Add handling for when DynamicBones is present on the same object as SecondaryMotion, as a soft dependency so it is not required to have it installed
v1.0.0
- Initial Release