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

Custom sword spins people and breaks bones or tears off limbs when stabbed #58

Open
Memelord44 opened this issue Sep 15, 2023 · 0 comments

Comments

@Memelord44
Copy link

Memelord44 commented Sep 15, 2023

I made a custom sword(a copy of the vanilla sword with a different sprite) and when I stab someone with it it spins them around uncontrollably and breaks bones or dismembers them.

I also tried using a retextured rod and adding a sharp axis but that didn’t work.

Relevant code:

ModAPI.Register(

new Modification()
{


    
    OriginalItem = ModAPI.FindSpawnable("Sword"), //item to derive from
    NameOverride = "Cutlass", //new item name with a suffix to assure it is globally unique
    DescriptionOverride = "Flimsy sword often used by pirates, has a sharp edge.", //new item description
    CategoryOverride = ModAPI.FindCategory("Pirate mod"), //new item category
    ThumbnailOverride = ModAPI.LoadSprite("Sprites/Cutlass.png"), //new item thumbnail (relative path)\
                AfterSpawn = (Instance) =>
                {


                  Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("Sprites/Cutlass.png");



                         /*  var properties = ModAPI.FindPhysicalProperties("Metal");

                          properties.Sharp = true;

                    properties.SharpAxes = new[]
                    {

                           new SharpAxis(Vector3.up, 0f, 0.5f, true, false),

                         //  new SharpAxis(-Object.transform.up, 0f, 0.5f, true, false)

                    };*/

                   Instance.GetComponent<PhysicalBehaviour>().Properties = properties;

             
                     Instance.FixColliders();

                }
                


}

);

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