Fully working afterimages and tail!



This was a fun technical challenge. Previously, my after image script worked by just saving the current sprite of the player, and putting that onto another object... but since I split the character sprite up in multiple parts (fore-sprite, back leg, and tail) this method no longer worked properly.. or rather, produced these results:


The solution was.. *takes a deep breath*
Dedicated render texture camera on the player 256x256
RenderTexture plugged into a shader to isolate everything on the 'Player' layer
shader outputs to a material
material is then mapped to a Texture2D
Texture2D is used in Sprite.Create to create a new sprite
which is then thrown to the after image object to be used as its Sprite!
phew.

Took a few more steps than I anticipated, but the result is exactly what I wanted!
I have a few more things to clean up, but afterwards I may put out a new build so you can try out the new sprite!

Many animations are still using the old sprite (all attacks, and taking damage)
but its getting there!

Get Project Kobold's Tale

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.