A functional bow with procedural string for unity.
- Procedural string using a line renderer
- Dynamic projectile strength depending on the draw time
- Easy to set up
- Add the
Bow
&Arrow
scripts into your project. - Drag the
Bow
script onto your bow and the Arrow script onto your arrow prefab.
Note: The
Arrow
script is solely for the rotation of the arrow. If you want to use your own script, remove all theArrow
references in theBow
script.
- Setup everything in the unity editor.
MinStrength
: The minimum force applied to the Projectile.MaxStrength
: The maximum force applied to the Projectile.DrawTime
: The time in seconds until the bow reaches full strength.DrawBackStrength
: The strength of which the string will be pulled back (Visual)ProjectilePrefab
: Projectile PrefabProjectilePoint
: The position at which the Projectile is being spawnedArrowRotation
: Default rotation of the arrowFpCam
: Your first person cameraUpper, Middle & Lower Line
: Points for the line renderer.Line Renderer
: Line Renderer of the Bow
Make sure you disable "Use World Space" option in your line renderer!
Contributions are welcome! Please feel free to submit a Pull Request.
- Add more (dynamic) points to the line renderer
- Clean up the scripts
- Add easing types to the DrawTime (e.g., Sine, Cubic, etc.)
- Add sound effects for drawing and releasing the bow
This project is dedicated to the public domain under the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. For more information, see the LICENSE file or visit CC0 Legal Code.