- Home /
,How to make a melee and Range combat system in unity
I use ScriptableObject for my Equipments some of them are melee weapons and others are ranged so i use a bool variable called "isRangedWpn" and check it if my Equipment is Ranged but I can't get the component value in my other combat script that have the attacking function, So how to return the value of a variable in ScriptableObject.
using UnityEngine; [CreateAssetMenu(fileName = "New Item", menuName = "Inventory/Item")] public class Item : ScriptableObject { new public string name = "New Item"; public Sprite icon = null; public bool isDefaultItem = false; public bool isRangedWpn; public virtual void Use() { } public void RemoveFromInventory() { Inventory.instance.Remove(this); } }
Your answer
Follow this Question
Related Questions
Problems With Weapon Sway 0 Answers
Making Weapon Switching Code more effective. 3 Answers
PhotonNetwork Switching Weapons (network sync) 3 Answers
Switching between prefabs 0 Answers