Public float pickUpRange // range at which a gun will be avaialable to pick up, will probably be constant in the end Public class WeaponPickUpController : MonoBehaviour * so I don't have to write this code in abstract class. WeaponScript will manage how a weapon behaves instead of this script, this is just a mediator * WeaponScript will be called and will be attached to each weapon as well depending on it's type with * This class will be attached to every gun to monitor it's actions on key presses. So when a user clicks mouse0 the bullet would shoot but there will be a delay before they can shoot again, as well as if the mouse0 is held then the weapon would shoot at specified firing rate.Ĭode for my controller: using UnityEngine What I am looking for is how to make that shooting happen at some interval. I am working on simple 2D rouge-like game with weapons, currently my weapon script only handles the shooting of weapon once a left mouse button is clicked.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |