- Home /
Creating a arrow string that can dynamically re size itself.
So I need to dynamically draw a string based on the distance an arrow was pulled, i'd prefer to do this with a sprite that can dynamically re size itself based on how far back the arrow was drawn. I'd have a raycast going that i had setup with a line renderer but the line renderer really gives me all sorts of weird issues and i want something that has a little bit more of an 8-bit look as i plan to make different looking bows. (Don't mind the slime he happened to jump in the shot when i was taking a picture)
Thank you for any help, or leads.
You can define a bowstring sprite like this:
And you can use the transform.localScale to make the line nearly straight and the angle as the arrow is drawn back. The problem is that a straight line will be really skinny, and the line will be come thicker the further you draw it back.
You can make 2 game objects cutting the @robertbu image by half. Then you can change the rotation and scale of the image to simulate a sting. Tip: If you change the pivot of a sprite it will scale accordingly, so put the pivot on the top of the sprite and it will scale downwards.
Answer by BMayne · Aug 31, 2014 at 05:59 AM
Hey There,
What I suggest is having your bow be an animation. While your drawing the bow it plays the animation. This animation could have the bow bending and the string being pulled. This could be done with a sprite sheet or bones.
Yeah making the bow bend as well would be really nice, that's a great suggestion. Wouldn't I have to key out the different animations based on the distance though?