Unity Crossbow test!

Опубликовано: 30 Июль 2026
на канале: Crescent games
219
3

Welcome to my medieval game! I have been working on a bow that shoots projectiles from something!
Yes, It's too fast, It still needs a LOT more work! The code to do this is:

var projectile : Rigidbody;
var speed = 100;

function Update () {

if (Input.GetButtonUp ("Fire1"))
{
clone = Instantiate(projectile, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection(Vector3 (0, 0, speed));

Destroy(clone.gameObject, 10);
}}