tModLoader Holding guns by stock?

Red 4

Terrarian
Anyone know how to fix holding the gun by the stock i know there is a way because calamity mod has you holding it in the right position
 

Attachments

  • Screenshot (6).png
    Screenshot (6).png
    352.5 KB · Views: 116
Example Mod's ExampleGun.cs file has something that may help. Specifically, these lines:

Code:
// Help, my gun isn't being held at the handle! Adjust these 2 numbers until it looks right.
public override Vector2? HoldoutOffset()
{
    return new Vector2(10, 0);
}

Example Mod should help you with where to place that. Fiddle with those two numbers until it's right.
 
Example Mod's ExampleGun.cs file has something that may help. Specifically, these lines:

Code:
// Help, my gun isn't being held at the handle! Adjust these 2 numbers until it looks right.
public override Vector2? HoldoutOffset()
{
    return new Vector2(10, 0);
}

Example Mod should help you with where to place that. Fiddle with those two numbers until it's right.
thank you
 
No problem.
one more thing if you don't mind do you know how to make npc not hold the gun by the stock too? i tried putting in the code (might sound stupid idk) but it gives me a error do you think i should search for the code in the example mod?
 
You may want to look through Example Mod.

By NPC, do you mean a Town NPC or a regular NPC (such as slimes)?

I assume it's a Town NPC. In that case, I cannot help, I've haven't made a Town NPC without having an error yet (though, now that I understand more about C#, and have Visual Studio, I may be able to succeed.).
 
Back
Top Bottom