tModLoader Modding Tutorial 3: Some More Weapons

How can I make the projectiles release from the barrel of the gun instead of the player? Tried 'position + vector2(x,y)' but it likes adjusting the projectiles spawnpoint, not released correctly from the barrel when rotating the gun.
Check out ExampleGun.cs, it has an example of doing that. But from my experience, it still has the weird angle while pointing upwards. You could probably fix this by offseting the angle, and using Vector2.RotatedBy(radians, center) with rotation offset of player mouse angle/ proj velocity for the final result
 
Check out ExampleGun.cs, it has an example of doing that. But from my experience, it still has the weird angle while pointing upwards. You could probably fix this by offseting the angle, and using Vector2.RotatedBy(radians, center) with rotation offset of player mouse angle/ proj velocity for the final result
Thanks. And with 2 projectiles each shot is there a way to make 1 of 2 projectiles stop moving while the other is acting normally. I'm trying to create the muzzle burst for the gun.
 
Thanks. And with 2 projectiles each shot is there a way to make 1 of 2 projectiles stop moving while the other is acting normally. I'm trying to create the muzzle burst for the gun.
Wdym
 
This has helped a lot with my first mod, but I was wondering where I put
public override Vector2? HoldoutOffset() => new Vector2(-8f, 0f);
in the code. That's all.
 
This has helped a lot with my first mod, but I was wondering where I put
public override Vector2? HoldoutOffset() => new Vector2(-8f, 0f);
in the code. That's all.
Anywhere inside the class, but outside of other methods
 
Back
Top Bottom