Need little help with my "laser"

Nyakote

Terrarian
I have a minion and it should attack enemies with a laser ( Laser should be always targeting the center of the Enemy )

i have some problems:
-it ain't doing any damage ( i have Projectile.NewProjectile method with setted damage = 50 ) //Attached image
-it looks kinda rough ( it ain't solid, doen't look like laser at all ) //Attached GIF
-it stucks inside enemy ( i idk how to describe this correctly ) //Attached GIF

I think that i'm using wrong method to create laser
 

Attachments

  • 1740145958702.png
    1740145958702.png
    85.9 KB · Views: 44
  • Untitled1.gif
    Untitled1.gif
    19.2 MB · Views: 47
  • Untitled.gif
    Untitled.gif
    15.2 MB · Views: 40
I know it's a bit off-topic, but do you want help with sprites?
 
Post the code for the Rainbow projectile itself
 
Post the code for the Rainbow projectile itself
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria.ID;
using Terraria;
using Terraria.ModLoader;
using tModPorter;
using HTDBasic.Content.Other;
using Microsoft.Xna.Framework;
using Microsoft.Build.Tasks;

namespace HTDBasic.Content.Projectiles.Minions
{
public class Rainbow : ModProjectile
{
public float Speed = 10;
public override void SetStaticDefaults()
{
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true;
}

public override void SetDefaults()
{
Projectile.width = 4;
Projectile.height = 4;
Projectile.hostile = false;
Projectile.damage = 50;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
Projectile.timeLeft = 60;
Projectile.penetrate = 1;
Projectile.extraUpdates = 2;
Projectile.DamageType = DamageClass.Summon;
}

public override void AI()
{

Player owner = Main.player[Projectile.owner];
Projectile.rotation = Projectile.velocity.ToRotation();
SearchForTarget.AISerchForTarget(owner, Projectile, out bool foundTarget, out float distanceFromTarget, out Vector2 targetCenter);
Vector2 targetDirection = targetCenter - Projectile.Center;
if (distanceFromTarget <= 10f)
{
Projectile.velocity = Vector2.Zero;
}
else
{
targetDirection.Normalize();
Projectile.velocity = targetDirection * Speed;
}



}
}
}
 
You have to set
Projectile.friendly = true;

In SetDefaults()
 
...make sprites? Yours look like placeholders.
idk how to work with sprites, so i did what i could. if you want to you can try make smth idk
 
You have to set
Projectile.friendly = true;

In SetDefaults()
i did this but it changed nothing/ i will to do something with it later, thx for the help
 
What is your minion supposed to be?
 
What is your minion supposed to be?
My friend got an idea of summon staff that summons Ponies from My Little Pony, every orb somehow represent a pony
 
My friend got an idea of summon staff that summons Ponies from My Little Pony, every orb somehow represent a pony
So, do you want orbs or ponies?
 
i think if would look better if those minions look like a proper pony
 
i think if would look better if those minions look like a proper pony
I’ll get to it soon; this coming week is pretty weird for me, but I’ll try my best.
 
good luck
 
Back
Top Bottom