Hi everyone!
First, please excuse my English, I know, it’s horrible and chaotic…
Anyway, I’ve got a little problem and I’d appreciate your generous help, gentle(wo)men!
This is it: I am working on my first bigger game and I am not able to code one little feature… I need to deformate a sprite of random shape with a mouse grab. I want to grab an edge of a sprite, drag it around and let the sprite “bend”, for example like a paper… I think I can find the edge of a bend quite easily, but I do not know, how to actually deform the sprite…
I’m sorry for my chaotic desription, this might help you to understand:
I will appreciate any help! Sorry for wasting your timee and thanks for reading…
Have a nice day and excuse my simplicity…
Yikes, this is a tough one. At least from the top of my head I can’t think of a solution that is easy to implement. I can only think of making each of these movements a set of complicated operations of defining the hinge that divides the sprite into A and B, maybe create another sprite and hide part A of the first and hide part B of the second, then rotate, mirror and reposition the second sprite so that it gives the illusion of bending around the hinge.
Another path could be to ditch the 2d thing and use 3d models (you can use orthographic camera to simulate 2d). Still not exactly simple, as you need a code that can edit polygons and manipulate them in real time, but I think it might be a better way.
edit: Are you a designer or something like that? that illustration seems like it was put together in minutes just to get the idea through, but it looks damn beautiful! even the “etc”! lol
Tahnks, this EXACTLY ran through my mind too… But I can’t handle it… Still, thanks for feedback…
And thank you, I’m definitely no designer, I just enjoy drawing nice thinks and thinking about visuals. Unfortunately, still a 17-years-old-student’s visuals. But yes, done in a minute, so…
Thank you very much…
EDIT: By the way, could you guys please tell me, what do you think about this character?
I think you will have to do this by creating some procedural geometry… or use an asset store tool. What you need to do is slice a straight cut through the original shape, then take the part that got cut off and mirror it (ie reflect it) across the cut line/perpendicular to it, and so long as you have a double-sided shader it should be ok. Then continue with that, snipping off sections of the geometry and flipping them across the cut line. But you’re either going to have to do this in script making your own meshes or use a third party mesh slicing tool.