RayCast MaximumRange added // Able to shoot in the air
This commit is contained in:
@@ -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;
|
||||
}
|
@@ -13,5 +13,5 @@ MonoBehaviour:
|
||||
m_Name: DataBullet
|
||||
m_EditorClassIdentifier:
|
||||
damage: 10
|
||||
speed: 5
|
||||
speed: 10
|
||||
ammo: 4
|
||||
|
Reference in New Issue
Block a user