How to make a long projectile appear a little at a time. Image reference.

Hello world. I want to make an enemy shoot a long projectile at the player. The problem I am having is that the sprite is premade. This means that when I instantiate or activate it, it fully appears. I want to make it seem like it’s coming out a little at a time (think of a fire breathing dragon). I’m thinking about adding another camera that will only see the projectile and make it’s (viewport, frustum, not sure which is the right word) only view part of the screen. The Main camera will not be moving so this will work exactly the way I want it, the problem is that it seems kinda inefficient to add another camera just for this. If there’s a better way I would love to hear it. Here’s an image of koopa shooting a fireball. Imagine it slowly coming out of his mouth and only the part that’s outside being visible. My projectile is longer so hiding it behind the character sprite won’t work because it’ll be visible past his back. I also want to point out that the projectile will be an arm, from fist to elbow.

30764-flamebreathing.jpg

Spawn the projectile BEHIND whatever’s shooting it. However if the projectile is too long you can achieve the effect with a spritesheet or by animating the rotation or scale.

Have your projectile’s scale start at 0 and rise to 1 in the time it takes your projectile to move far enough away.

If you dont want to use scale you can rotate it so it’s edge is facing the camera.

This should be easy enough to accomplish using animator states.

I’d have an idea, not sure if it works too nicely but it’s worth a try;
Try getting the Texture2D of the sprite and dynamically set the pixels to black depending on the time. That way you might have 90% black pixels at the start and slowly reduce that number over time until you reach 0% which is when the sprite is fully visible. Again, this is sort of vague, but I hope it points you in the right direction.