Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for Ragdoll Power Profiles. Updating power settings for individual bones at runtime #4

Open
SkyYurt opened this issue May 27, 2021 · 0 comments

Comments

@SkyYurt
Copy link

SkyYurt commented May 27, 2021

Could you add an API for the Power Profiles so that I could change the power setting for one of the bones at runtime.
A method like this should be sufficient:

void SetBoneSetting(BoneName bone, PowerSetting setting)
{
    settings[bone] = setting;
}

Additionally a component that we could attach to the ragdoll bone, that could be called and have its' power settings changed at runtime.
Right now I solve this issue by using RagdollDefinitionBindings to get the BoneName and then get the RagdollBone by again using RagdollDefinitionBindings:

if (bindings.TryGetBoundBoneName(joint, out BoneName boneName)) {
    if (bindings.TryGetBone(boneName, out RagdollBone bone)) {
        bone.PowerSetting = PowerSetting.Powered;
        bone.Rigidbody.isKinematic = false;
        bone.Rigidbody.collisionDetectionMode = CollisionDetectionMode.Continuous;
    }
}

It could be awesome if we could simplify this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant