Ground pet sprite in ground

Xekono

Plantera
public class HydraPet : ModProjectile
{
public override void SetStaticDefaults() {
DisplayName.SetDefault("LavaHydra");

Main.projFrames[Projectile.type] = 17;
Main.projPet[Projectile.type] = true;
}

public override void SetDefaults() {
Projectile.CloneDefaults(ProjectileID.FennecFox); // Copy the stats of the Fennec Fox

AIType = ProjectileID.FennecFox; // Copy the AI of the Fennec Fox
}

public override bool PreAI() {
Player player = Main.player[Projectile.owner];


return true;
}

public override void AI() {
Player player = Main.player[Projectile.owner];

// Keep the projectile from disappearing as long as the player isn't dead and has the pet buff.
if (!player.dead && player.HasBuff(ModContent.BuffType<HydraPetBuff>())) {
Projectile.timeLeft = 2;
}
}
}
(Yes, I can't code (I understand most of the code provided but, that's it. custom stuff is a bit too much for me :confused:), and am just using the fennec fox AI.)
I wanted to ask how I adjust the sprite y, or make the sprite align with the ground. The code works otherwise
 
I would say, make sure you align your sprite sheet with the sprite sheet of the fennec fox. It should all work fine with that.
 
I would say, make sure you align your sprite sheet with the sprite sheet of the fennec fox. It should all work fine with that.
I have, but, for some reason, it still wants to go into the ground (And more the longer the image is). I tried making the sprite sheet longer (And wider), with not much luck. I'm probably doing something wrong, aren't I? Do you know if there's some sort of override?

RefLines.PNG
WhyIsIt.PNG
 
Last edited:
I would say, make sure you align your sprite sheet with the sprite sheet of the fennec fox. It should all work fine with that.
Nvm, I fixed it. I feel dumb now. (Just had to add width and height) Thank you for helping :)
 
Back
Top Bottom