RayCast MaximumRange added // Able to shoot in the air

This commit is contained in:
klikev
2024-06-16 13:50:01 +02:00
parent 79c7d841af
commit da9121462f
5 changed files with 77 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BulletMoving : MonoBehaviour
public class BulletScript : MonoBehaviour
{
public DataBullet dataBullet;
@@ -40,7 +40,7 @@ public class BulletMoving : MonoBehaviour
// Update is called once per frame
void Update()
{
rb.velocity = direction * dataBullet.speed;
rb.velocity = direction.normalized * dataBullet.speed;
die(lifetime);
time += Time.deltaTime;
}

View File

@@ -13,5 +13,5 @@ MonoBehaviour:
m_Name: DataBullet
m_EditorClassIdentifier:
damage: 10
speed: 5
speed: 10
ammo: 4