0
\$\begingroup\$

I am designing a 2d platformer with pixel 32x32 sprites, right now I’m using the method that’s utilized at 20 minutes in this video.

I’m pretty much creating a main player parent object and adding the players equipment (helmet, breastplate, leggings) sprites underneath. But obviously when the player animates and starts running the pixel equipment needs to move and shift with the player.

The solution provided by the video seems to work fine, but why can’t this just be called once at the start and be set until changed? Basically why can’t I set the sprites at the different frames of the animation when the game starts and leave it. I basically redrew all of equipment to fit the character during each frame of the run animation etc. If I equip a specific helmet, I just want to set all the sprites in the animation once, and if I replace the equipment, a new sprite sheet is used that contains the breastplate and its animations during the run animation for example.

Is there any way to not repeatedly set renderer.sprite for each sprite in an animation via the late update function? I’m just worried that the function I attached will cause animation lag or lag to the game in general.

(I do not wish to piece and part the character together, especially not a 32 pixel drawing, and boning the character and stretching the pixels is definitely not a good option either)

enter image description here

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Please share your code as text, not as a screenshot. If you need help with formatting it correctly, see the help center. \$\endgroup\$
    – DMGregory
    Mar 2 at 3:15
  • \$\begingroup\$ I can post it as soon as I get to my computer! Thanks for the quick response! @DMGregory \$\endgroup\$ Mar 2 at 3:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.