Night Run Studio
Night Run Studio
  • 231
  • 624 254
Animating and Improving Ranged Attacks in Unity (Tutorial)
Let's set up our Ranged Attack with animations and improvements so that it's more like something you'd see in classic games like The Legend of Zelda: A Link to the Past. In this video we'll add:
- 8 directional animations
- arrows that stick to objects
- weapon swapping with a button press
- halting movement while shooting
- various tweaks and improvements
Feel free to enjoy this video on its own, or as part of a beginner-friendly series where we create an Action RPG in the style of Zelda: A Link to the Past.
RELEASE SCHEDULE
I'm planning to release a new video each Monday until the series is complete. If you'd like to help out a little studio to speed up this process, feel free to give me a Super Thanks, check out my patreon account, like this video, or leave me a comment.
ASSETS USED
Assets used in this video are from PixelFrog's "Tiny Swords" asset pack. You can find the asset pack on itch.io:
pixelfrog-assets.itch.io/tiny...
🔗PATREON LINK🔗
With a little support, I can make time to double the release schedule, providing two videos each week. Check out the campaign:
/ nightrunstudio
🎹 MUSIC 🎹
Town Music
Night Run Studio
from the Willard Soundtrack
Moonlight
Night Run Studio
from the Willard Soundtrack
Переглядів: 926

Відео

Ranged Attack: Firing Arrows in Unity (Tutorial)
Переглядів 83514 днів тому
In this video we'll set up the ability to fire arrows, similar to what you see in classic games like The Legend of Zelda: A Link to the Past. In this video we'll add: - 8 directional shooting - rotating arrows - enemy damage - knockback Next week I'll add a follow-up video which will include: - Animation for shooting (up to 8 different animations) - Burying the arrow into targets - Improved col...
Shooting with A Bow and Arrow (Series Preview)
Переглядів 46428 днів тому
Next up on the channel, we are going to look at how to add bow and arrow abilities into your game. This one will be a two-part series with the first video looking at most of the functionality, while the second video will make it look good, adding 8 directional animations, and the ability to swap weapons on a button press. This video works as a standalone, and will introduce the concept of the O...
Skill Tree In Unity (Tutorial) --- Part III: Finishing the System!
Переглядів 567Місяць тому
Skill trees are awesome... but they can get a little complicated to implement. This video series tries to provide a powerful, adaptable skill tree, while keeping the code as intuitive and clean as possible. This system should scale well for large games, but I try to explain things enough that even relative beginners can figure it out. In the first video, we looked at one way to design the User ...
Skill Tree In Unity (Tutorial) --- Part II: Coding the Skills and System
Переглядів 595Місяць тому
Skill trees are awesome... but they can get a little complicated to implement. This video series tries to provide a powerful, adaptable skill tree, while keeping the code as intuitive and clean as possible. This system should scale well for large games, but I try to explain things enough that even relative beginners can figure it out. In the first video, we looked at one way to design the User ...
Skill Tree In Unity (Tutorial) -- Part I: The User Interface
Переглядів 671Місяць тому
Skill trees are awesome... but they can get a little complicated to implement. This video series tries to provide a powerful, adaptable skill tree, while keeping the code as intuitive and clean as possible. This system should scale well for large games, but I try to explain things enough that even relative beginners can figure it out. In this first video, we will set up the UI for our skill tre...
Creating An Adaptable, Powerful Skill Tree In Unity (Series Preview)
Переглядів 618Місяць тому
Skill trees are awesome... but they can get a little complicated to implement. This video series tries to provide a powerful, adaptable skill tree, while keeping the code as intuitive and clean as possible. This system should scale well for large games, but I try to explain things enough that even relative beginners can figure it out. This video works as a standalone, and will introduce the con...
Experience and Levelling System in Unity (with Experience Slider Bar)
Переглядів 1,5 тис.2 місяці тому
Experience points and levelling are an important part of most RPGs, so in this video, we'll implement a system that will set us up for both. We will also lay some ground work that will set us up for an upcoming video where we will add a Talent Tree with unlockable abilities. This video works as a standalone, and will introduce the concept of the Observer Pattern, a powerful way to send message ...
Creating A Stats System in Unity (Part III: Connecting the UI and Pausing)
Переглядів 7072 місяці тому
You can't have an Action RPG without stats! But figuring out how to organize them can be tricky. In this video we'll look at a beginner-friendly approach that scales nicely for larger projects, making this system intuitive and powerful. This will be a 3-part series: Part I: Set up and code the Stats System Part II: Create the User Interface Part II: Connect the Code and the UI This video works ...
Creating A Stats System in Unity (Part II: Creating the UI)
Переглядів 1,1 тис.2 місяці тому
You can't have an Action RPG without stats! But figuring out how to organize them can be tricky. In this video we'll look at a beginner-friendly approach that scales nicely for larger projects, making this system intuitive and powerful. This will be a 3-part series: Part I: Set up and code the Stats System Part II: Create the User Interface Part II: Connect the Code and the UI This video works ...
Creating A Stats System in Unity (Part I: Coding the System)
Переглядів 1,3 тис.2 місяці тому
You can't have an Action RPG without stats! But figuring out how to organize them can be tricky. In this video we'll look at a beginner-friendly approach that scales nicely for larger projects, making this system intuitive and powerful. This will be a 3-part series: Part I: Set up and code the Stats System Part II: Create the User Interface Part II: Connect the Code and the UI This video works ...
Creating Multi-level Tilemaps: Action RPG in Unity Tutorial #4.5
Переглядів 1,7 тис.2 місяці тому
Tilemaps can seem pretty straightforward... until you try to add more levels. Organizing layers and swapping colliders can be a lot to figure out at first. So in this video we look at how to get your layers setup and write a script to toggle out colliders so the player can climb mountains, and our world can feel a little more... vertical. This video works as a standalone tutorial, but it is als...
Knockback and Stun Effects: Action RPG in Unity Tutorial #14
Переглядів 1 тис.2 місяці тому
Knockback and Stun Effects: Action RPG in Unity Tutorial #14
Damaging Enemies: Action RPG in Unity Tutorial #13
Переглядів 5822 місяці тому
Damaging Enemies: Action RPG in Unity Tutorial #13
Attacking Enemies (with Animation and Cooldown): Action RPG in Unity Tutorial #12
Переглядів 8713 місяці тому
Attacking Enemies (with Animation and Cooldown): Action RPG in Unity Tutorial #12
Willard | Teaser Trailer
Переглядів 8063 місяці тому
Willard | Teaser Trailer
Huge Progress on My City Builder Dream Game| Devlog
Переглядів 2,2 тис.3 місяці тому
Huge Progress on My City Builder Dream Game| Devlog
What If NPCs Needed Purpose? | Devlog
Переглядів 9313 місяці тому
What If NPCs Needed Purpose? | Devlog
Making Smarter NPCs | Devlog
Переглядів 3,9 тис.4 місяці тому
Making Smarter NPCs | Devlog
Knockback Effect (with Dodging!): Action RPG in Unity Tutorial #11
Переглядів 1,1 тис.4 місяці тому
Knockback Effect (with Dodging!): Action RPG in Unity Tutorial #11
Enemy Attack State: Action RPG in Unity Tutorial #10
Переглядів 1,4 тис.4 місяці тому
Enemy Attack State: Action RPG in Unity Tutorial #10
Two Years Making My Dream Game
Переглядів 1,4 тис.4 місяці тому
Two Years Making My Dream Game
Making Smarter Enemies: Action RPG in Unity Tutorial #9
Переглядів 1,4 тис.5 місяців тому
Making Smarter Enemies: Action RPG in Unity Tutorial #9
Chasing the Player (with Aggro Range): Action RPG in Unity Tutorial #8
Переглядів 2,7 тис.5 місяців тому
Chasing the Player (with Aggro Range): Action RPG in Unity Tutorial #8
Health Display UI: Action RPG in Unity Tutorial #7
Переглядів 1,2 тис.5 місяців тому
Health Display UI: Action RPG in Unity Tutorial #7
Adding a Health System (And Damage!): Action RPG in Unity Tutorial #6
Переглядів 1,3 тис.5 місяців тому
Adding a Health System (And Damage!): Action RPG in Unity Tutorial #6
Camera Follow (Intro to Cinemachine): Action RPG in Unity Tutorial #5
Переглядів 7765 місяців тому
Camera Follow (Intro to Cinemachine): Action RPG in Unity Tutorial #5
Adding Foreground and Background Layers to Tilemaps: Action RPG in Unity Tutorial #4
Переглядів 1,5 тис.5 місяців тому
Adding Foreground and Background Layers to Tilemaps: Action RPG in Unity Tutorial #4
Tilemaps In Unity: Action RPG in Unity Tutorial #3
Переглядів 2,2 тис.5 місяців тому
Tilemaps In Unity: Action RPG in Unity Tutorial #3
Walk, Idle, and Turn Around: Action RPG in Unity Tutorial #2
Переглядів 1,6 тис.5 місяців тому
Walk, Idle, and Turn Around: Action RPG in Unity Tutorial #2

КОМЕНТАРІ

  • @totallyoffgrid3008
    @totallyoffgrid3008 День тому

    This is the video I was looking for to understand how to attach a specific item to a specific enemy. Now I get it.

  • @ProtoItera
    @ProtoItera День тому

    Super!!!

  • @hellomynameis5760
    @hellomynameis5760 День тому

    man you are so good!

  • @tranquanganhthuanfgwhcm5104
    @tranquanganhthuanfgwhcm5104 3 дні тому

    Hi, is there another way to drop item but still keep MeshRenderer and MeshFilter to show the 3d object, for I applied this for 3d game and it actually worked except for the drop system, great tutorial anyway !

    • @NightRunStudio
      @NightRunStudio 2 дні тому

      Glad the video was helpful! I think the easiest way to do this in 3D would be to create an item prefab that takes in an itemSO instead of creating an item out of nothing like I do in the video. You would just instantiate the itemPrefab (in the same place I do in this video), and alter its appearance and name based on the itemSO (similar to what I do in the video, but without the sprite part). I hope that points you in the right direction.

    • @tranquanganhthuanfgwhcm5104
      @tranquanganhthuanfgwhcm5104 2 дні тому

      @@NightRunStudio Ok, I will try, thank you very much!

  • @myredneckway9608
    @myredneckway9608 3 дні тому

    I am currently following your tutorials and cannot get past the 2nd one. I am getting an error message even after your fix. Assets\Editor\item.cs(17,13): error CS0246: The type or namespace name 'InventoryManager' could not be found (are you missing a using directive or an assembly reference?) using System.Collections; using System.Collections.Generic; using UnityEngine; public class Item : MonoBehaviour { [SerializeField] private string itemName; [SerializeField] private int quantity; [SerializeField] private Sprite sprite; private InventoryManager inventoryManager; ((((((this is where the error is at)))))) //Started is called before the first frame update void Start() { } //Update is called once per frame void Update() { inventoryManager = GameObject.Find("InventoryCanvas").GetComponent<InventoryManager>(); } private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "Player") { inventoryManager.AddItem(itemName, quantity, sprite); Destroy(gameObject); } } } Can you help with this?

  • @lanefaulhaber1824
    @lanefaulhaber1824 4 дні тому

    I am confused though. Why even use a scriptable object? If I wanted to track an enemy's health, wouldn't I need to keep track of it for that specific instance? I know health was not an example that you used in the video. But if health of one enemy changed for example, it would affect all other enemies with that scriptable object since their nature is read-write. But what is the practical purpose of a scriptable object. I know they can lower dependencies. But what if I don't want my values to be static and I want them to be able to change? This is something I am struggling with understanding with scriptable objects. And then all those states are still dependent on those scriptable objects, so they would need to be present in the project anyway for the code to work. Could you explain the advantages I may be missing here?

    • @NightRunStudio
      @NightRunStudio 3 дні тому

      I love it when people ask good questions! You've hit on the main ones so far... 1) Separation of Concerns and Encapsulation Holding your data in one place helps keep your other scripts more readable, and lets them focus on DOING stuff rather than remembering stuff. 2) Memory overhead Rather than adding all this data into your scene every time you add an enemy, there is only one copy of the stats that lives in your assets rather than in your scene 3) Easy Editing Once the project gets quite large, it's often easier to sort through scriptable objects when balancing enemies than it is to sort through enemies (where their stats could appear in multiple scripts and require you to sort through all sorts of other non-stat variables while you are editing them) I hope that helps a bit. SOs aren't the only way to handle this sort of data, but for these reasons it seems that most programmers are using them. Also, when it comes to a stat like Health, I would only store the base health in an SO. You would want to handle current Health and Buffs in a separate script which would load the max health to start, but then handle all of it's own current health. Again, this sort of thing makes more sense the larger your game gets. Cheers!

  • @totallyoffgrid3008
    @totallyoffgrid3008 4 дні тому

    This is the episode I have been waiting for. Can you assign multiple types of things to chase?

    • @NightRunStudio
      @NightRunStudio 4 дні тому

      Do you mean like in the case of an enemy chasing an NPC or another type of enemy in addition to the player?

    • @totallyoffgrid3008
      @totallyoffgrid3008 4 дні тому

      @ thank you for the response. Yes. I have 2 or things I trying to research. 1) having an enemy or even NPC attack another NPC. 2) how to recruit an NPC to an Army, and 3) how to recruit and make an NPC follow you.

    • @NightRunStudio
      @NightRunStudio 4 дні тому

      @@totallyoffgrid3008 The code to chase other NPCs would work just like this, except that you'd have to add tags other than just the Player tag. That said, having enemies attack each other is a little more complex... that said, the code I use here would be a good foundation--you'd just have to build on it and balance it, The code for an NPC to follow you could work the same way as this chase, though you would probably want an offset, so they stop chasing once they get within a certain distance (like, say 1 unit).

    • @totallyoffgrid3008
      @totallyoffgrid3008 4 дні тому

      @@NightRunStudio that could work. I am trying to create a multi-player capture the flag where you can take some troops and attack other regions. So I am trying to find a way where you could select about 7 NPCs and attack. Or if you wanted, you could have a friend fill a slot.

    • @totallyoffgrid3008
      @totallyoffgrid3008 3 дні тому

      I do have another question…..do I need to add the script every time I insert an enemy sprite, or is there a way to populate my map by dragging and dropping and having the script and everything already attached…?

  • @SorceressGamelab
    @SorceressGamelab 5 днів тому

    Again another great video! Will you make a video on how to visualize what weapon the player is currently using? Like a small image in the corner showing either the sword or the bow? Can you give some pointers on how to set that up? Can we just add an image for each weapon to the change equipment script and add an if statement okay if this weapon is enabled then show this image? Or is there more to it? Thank you!

    • @NightRunStudio
      @NightRunStudio 5 днів тому

      I hadn’t planned on adding this… but you’ve got me thinking so it might make an appearance. That said, this would actually be pretty easy to set up using UI buttons. You could mostly use our existing swap code, but rather than putting it in update and looking for a button press, you could put create its own method and have that get called by the button. You could get even fancier and create a separate method for each state type or something like that.

  • @julenmontes8575
    @julenmontes8575 5 днів тому

    Very complete as usual, Im currently trying to shoot with a slingshot with a 3d model and this helped a lot!

    • @NightRunStudio
      @NightRunStudio 5 днів тому

      That’s awesome! Glad to hear the code is helpful for other applications.

  • @randominsaan7862
    @randominsaan7862 5 днів тому

    Hey hope you remember me I kinda stopped development due to irl problems hope I can get back onto the journey again soon

    • @NightRunStudio
      @NightRunStudio 5 днів тому

      I wish you the best irl! And hope you're able to get back at game dev soon. Cheers.

    • @randominsaan7862
      @randominsaan7862 5 днів тому

      @NightRunStudio thanks ❤️

  • @depavanmeijr
    @depavanmeijr 6 днів тому

    Yeyyyy🎉

  • @Grommmasch
    @Grommmasch 6 днів тому

    👍

  • @kamm3021
    @kamm3021 6 днів тому

    Awesome work like always 👍 That assets pack definitely made this a way better series

    • @NightRunStudio
      @NightRunStudio 6 днів тому

      Thanks for the feedback. I’m learning that it’s nice if viewers have access to the assets if they want to follow along.

    • @kamm3021
      @kamm3021 6 днів тому

      Yeah for sure

  • @TweetyStickFigure
    @TweetyStickFigure 8 днів тому

    I spent 10 minuets trying to figure out what I did wrong. I spelt Inventory as Invetory. I love being dyslexic. Just make sure your spelling is correct unlike mine

  • @mileselectric3677
    @mileselectric3677 9 днів тому

    the way that i currently have the enemy/monster coded doesnt allow for me to have the Parent hold the weakpoint. is there a way to make it where colliding with the weakpoint destroys the parent when its a child of that parent? also because of how my colliders are set up i take damage whenever i collide with the weakpoint due to itt being a child of the enemy/monster. how cani stop the player from taking damage when hitting the weakpoint in that case? would it be as simple as swapping the tags and adjusting the colliders?

    • @mileselectric3677
      @mileselectric3677 9 днів тому

      it was as simple as swapping the tags and editing the colliders. if anyone has this issue in the future this helped me hope it helps others

    • @mileselectric3677
      @mileselectric3677 9 днів тому

      edit after swapping the next issue is have an enemy that you can damage but cant damage you currently looking for a fix

    • @mileselectric3677
      @mileselectric3677 9 днів тому

      okay the issue following this discovery is that the collider thats set now moves if collided with by any solid object if that solid object is the player it pushes the collider out of the way so that you collide with the weakpoint causeing the enemy to die, so we need to keep the collider in the right spot instead of moving left or right when touched.

    • @mileselectric3677
      @mileselectric3677 9 днів тому

      edit i found that when putting the rigidbody2d on the child it is what causes the collider to move and displace itself from the parent, but it is also what allows the player to take damage without it no damage can be done to the player. Dynamic causes the collider to shift, Kinematic works but effects gravity making the enemy and makes the enemy get stuck in the ground slightly, they can still move and chase properly but will fall slowly towards the ground if they enter the air. Static doesnt help at all.

    • @mileselectric3677
      @mileselectric3677 9 днів тому

      all that is needed is to figure out how to add gravity to a kinematic rb2d

  • @JoshuaTreeJoinery
    @JoshuaTreeJoinery 9 днів тому

    great vid man, did anyone ever tell you you sound just like the lock picking lawyer?

    • @NightRunStudio
      @NightRunStudio 9 днів тому

      Haha. Nope, that’s definitely a first! Glad you enjoyed the video.

  • @Austin-if7ne
    @Austin-if7ne 9 днів тому

    This is awesome

  • @Xxadamswagxxx
    @Xxadamswagxxx 9 днів тому

    bruh most codes ur using dosent show off like destroy.. do i have to download somthing before?

    • @NightRunStudio
      @NightRunStudio 7 днів тому

      Sorry... just saw this, but not quite sure what you mean. If you give me a little more detail I'd be happy to help.

  • @mileselectric3677
    @mileselectric3677 10 днів тому

    when the enemy is moving it does 2x damage to player but when the enemy cant move damage works as intended. how can i fix this?

    • @NightRunStudio
      @NightRunStudio 10 днів тому

      Does the enemy or player have multiple colliders? If so, that could explain the method multi firing. You could also add a bool variable (like hasDealtDamage) and 1) have the damage only occur if it is false; 2) turn it true right after the if statement; 3) then turn it false again after dealing the damage. That should work as a failsafe to only fire once.

    • @mileselectric3677
      @mileselectric3677 10 днів тому

      @@NightRunStudio there is multiple i deleted one and its fixed now. but what if i want to damage the enemy by jumping on its head, would i have to decide where the damage gets applied?

    • @NightRunStudio
      @NightRunStudio 10 днів тому

      One option would be to put the collider and damage script on a child object (while the main collider would be on another game object); another route would be to use a trigger for damage instead; or there’s the idea I mentioned earlier where you could create a bool to serve as a flag so it only gets applied the one time.

  • @4ebyre4naya34
    @4ebyre4naya34 10 днів тому

    Perhaps a storage system tutorial somewhen? Would be a great addition to this series

    • @NightRunStudio
      @NightRunStudio 10 днів тому

      Thanks for the idea! I’m thinking of doing an updated version of this system in my RPG series (with some of the suggestions people have given me over time). If I do, will definitely look at adding things like a shop and storage.

    • @4ebyre4naya34
      @4ebyre4naya34 10 днів тому

      @@NightRunStudio Thank you, would gladly watch, cuz i followed the inventory system tutorial, works like a charm. Now i gotta somehow make storages and stuff which is complicated especially because im new to all this game dev stuff

    • @NightRunStudio
      @NightRunStudio 10 днів тому

      @4ebyre4naya34 yeah, it gets a little tricky. You could do something similar to what we do in the equipment series (when you drag the equipment from the inventory onto the character), but that’s a lot to figure out when you’re new. I think when I finally make this video I’ll show how to put the items into a dictionary for easier cataloguing and moving.

  • @HIDEY_RUNNYpigs
    @HIDEY_RUNNYpigs 11 днів тому

    The tutorial was really good but I ran into an error that says "Coroutine couldn't be started because the the game object 'Player' is inactive! UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator) PlayerMovement:KnockBack (UnityEngine.Transform,single,single) (at Assets/Scripts/PlayerMovement.cs:45) Enemy_Combat:Attack () (at Assets/Scripts/Enemy_Combat.cs:22)" after the player dies it that normal?

    • @NightRunStudio
      @NightRunStudio 11 днів тому

      That is pretty normal. Eventually we should put some death logic into the game to avoid this. In the meantime, if you put if(player.gameObject != null) in the previous line it should fix the problem so that it only tries to run that line if player is active.

    • @HIDEY_RUNNYpigs
      @HIDEY_RUNNYpigs 11 днів тому

      @@NightRunStudio Ok thanks!

  • @Apurv_Lall
    @Apurv_Lall 12 днів тому

    Is the series complete ?

    • @NightRunStudio
      @NightRunStudio 12 днів тому

      No… I’m on a one week vacation, and now… the next one will drop in about a week.

    • @Apurv_Lall
      @Apurv_Lall 12 днів тому

      @NightRunStudio olay

    • @Apurv_Lall
      @Apurv_Lall 12 днів тому

      @@NightRunStudio how many vids will it take to complete it? Can I use the assets and some part of codes for my games?

    • @NightRunStudio
      @NightRunStudio 11 днів тому

      The assets are free for commercial use (I included a link in the first video which has all the copyright info). The code is also all free to use. There’s no special copyright on the way I do things-most of it is pretty standard. I’m not sure how long the series will go. If it is popular enough I’ll keep adding topics for the next few months, that said, if it doesn’t catch on I might wrap it up soon.

    • @Apurv_Lall
      @Apurv_Lall 11 днів тому

      @@NightRunStudio cool!

  • @SamanthaDurfee
    @SamanthaDurfee 12 днів тому

    How did you make your items pickable when player walks over them if there is a collider on the my item just gets pushed around by the player

    • @NightRunStudio
      @NightRunStudio 12 днів тому

      Are you using OnCollisionEnter2D to pick them up? Another method is to create a trigger that is larger than the collider that notices once’s the player enters.

    • @SamanthaDurfee
      @SamanthaDurfee 11 днів тому

      I was using on trigger but I guess changing it it collision2d would be better?? Also could you do a tutorial for a flying 2d enemy platformer please??

    • @SamanthaDurfee
      @SamanthaDurfee 11 днів тому

      I followed all these but it's confusing how to make the enemy stay flying with a rigid body2d and gravity bring on

    • @NightRunStudio
      @NightRunStudio 11 днів тому

      Most of the time if you want the enemy to fly, you would turn off the gravity scale… unless of course you want it to drop and then lift off again (which gets more complex).

    • @SamanthaDurfee
      @SamanthaDurfee 8 днів тому

      @@NightRunStudio So yeah i turned off gravity scale and when i attack the enemy i chases them and goes to the ground but doesnt go back up and just stays at the ground? any idea how to fix this?

  • @paweswiezy578
    @paweswiezy578 12 днів тому

    Hi, i have a problem which i cant deal by myself, whenever my attackpoint is in range of Enemys DetectionPoint, the enemy is receving damage, i dont have to punch him, i just have to punch detectionCircle to deal him a damage, can you help me fix that?

    • @NightRunStudio
      @NightRunStudio 12 днів тому

      That sounds like your brackets and if statement may be misplaced. It should only check for an enemy when you press the button. I would start by making sure the input check is working properly.

    • @paweswiezy578
      @paweswiezy578 11 днів тому

      @@NightRunStudio sorry i wrote it wrong, the enemy is recieving damage only when i press the slash key, but i can deal him damage when i collide with his detectionPoint with detectionRadius, which is far further then the enemy collider

    • @Tofrellaz
      @Tofrellaz 9 годин тому

      Same problem.Player attacks interact with detection collider.

    • @NightRunStudio
      @NightRunStudio 4 години тому

      @@Tofrellaz The easiest fix for this is to place: if (enemies[0].isTrigger) { return; } immediately after the line: if (enemies.Length > 0) In the DealDamage() method. That way, it wont mistake the trigger for the enemy itself. Hope that helps!

    • @Tofrellaz
      @Tofrellaz 47 хвилин тому

      @@NightRunStudio Problem solved! Thank you mate! You're doing an amazing job, great teacher. Learning a lot from you! You deserve way more followers!

  • @SamanthaDurfee
    @SamanthaDurfee 12 днів тому

    patrol state isnt playing for me :( Any idea why? and I have it set as the default state

    • @SamanthaDurfee
      @SamanthaDurfee 12 днів тому

      AHH i see my animations name was capital P instead of lower case!!

  • @paweswiezy578
    @paweswiezy578 12 днів тому

    These videos feels criminal to watch for free

  • @rragy1848
    @rragy1848 13 днів тому

    Great video as usual! Thanks Matt ! :)

  • @Grommmasch
    @Grommmasch 14 днів тому

    Support!!

  • @Grommmasch
    @Grommmasch 14 днів тому

    Thanks😊

  • @PiglinGold99
    @PiglinGold99 14 днів тому

    In any of the tutorials do you ever set up the animations or do we figure that out ourselves?

    • @NightRunStudio
      @NightRunStudio 13 днів тому

      In episode 3 I do animating and flipping. And then in the ranged attack series I show how to set up the archer attacks (since they are more complicated). Each time we add a new state, I show how to set up the animator, but I don’t go over any other animations specifically.

    • @PiglinGold99
      @PiglinGold99 13 днів тому

      @@NightRunStudio I mean for the goblin, and I've tried making a rpg before and I got stuck on the animations and the way you explain it is really nice as this is my 3rd day even having unity installed.

    • @NightRunStudio
      @NightRunStudio 13 днів тому

      @PiglinGold99 gotcha. Yeah, I don’t show how to make the animations, but I do show the animator setup.

    • @PiglinGold99
      @PiglinGold99 13 днів тому

      @@NightRunStudio Okay!

  • @PiglinGold99
    @PiglinGold99 14 днів тому

    When ever I spawn multiple enemies when one dies they all die. anyway to dix that?

    • @NightRunStudio
      @NightRunStudio 14 днів тому

      If you look in the hierarchy, are the enemies all spawning as children of the same object? If so, then destroying the parent would destroy all of them.

    • @PiglinGold99
      @PiglinGold99 14 днів тому

      @@NightRunStudio Yes they are, thank you. Also I've started your RPG tutorial and just want to say it's one of the best tutorials for anything I've ever seen

    • @NightRunStudio
      @NightRunStudio 14 днів тому

      @PiglinGold99 that’s high praise! Thanks!

  • @Grommmasch
    @Grommmasch 14 днів тому

    thx you

  • @STEALTH-ct5kc
    @STEALTH-ct5kc 15 днів тому

    My items are not stacking, just going to the next slot to fill up

  • @pjonpepper
    @pjonpepper 15 днів тому

    Great tutorial! It's simple and to the point. Keep up the good work, man!

  • @Derekstefan
    @Derekstefan 15 днів тому

    Great tutorial. I just solved a problem that seemed to happen to a few people in the comments and that I was having also. That is object reference not set to an instant of an object or NullReferenceException. Try this line: EnemyHealth enemyHealth = enemy.GetComponentInParent<EnemyHealth>();

    • @NightRunStudio
      @NightRunStudio 15 днів тому

      Great tip! Thanks for leaving the solution for others!

  • @ringleaderwilliam5031
    @ringleaderwilliam5031 15 днів тому

    Cool, very detailed

  • @DEATHFACE541
    @DEATHFACE541 17 днів тому

    I did it for 6 characters " public class PlayerSwitch : MonoBehaviour { public PlayerControls playerController; public PlayerControls player2Controller; public PlayerControls player3Controller; public PlayerControls player4Controller; public PlayerControls player5Controller; public PlayerControls player6Controller; public int activePlayerIndex = 0; // Keeps track of the current active player (0-based index) // Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.RightShift)) { SwitchPlayer(); } } public void SwitchPlayer() { // Disable all player controllers initially playerController.enabled = false; player2Controller.enabled = false; player3Controller.enabled = false; player4Controller.enabled = false; player5Controller.enabled = false; player6Controller.enabled = false; // Increment the active player index and loop back to 0 if it exceeds the number of players activePlayerIndex = (activePlayerIndex + 1) % 6; // Enable the next active player based on the index switch (activePlayerIndex) { case 0: playerController.enabled = true; break; case 1: player2Controller.enabled = true; break; case 2: player3Controller.enabled = true; break; case 3: player4Controller.enabled = true; break; case 4: player5Controller.enabled = true; break; case 5: player6Controller.enabled = true; break; } } } " if you guys need it

  • @realmcraftchronicles
    @realmcraftchronicles 17 днів тому

    I made my item class abstract. and used inheritance for things like weapons and potions. Instead of enum, i had the potionSO use int hp and int mp. Then when i create the potion, i can choose one or both and pass that to my hero. I'm less than a month in, but would like your thoughts on this if you have any. I started an inventory system before watching this series, but I'm not going any further until i finish this series.

    • @NightRunStudio
      @NightRunStudio 17 днів тому

      This sounds like a great idea. For my own project, I am also using inheritance. That said, when I first started with inventories, I found that adding inheritance to the other complications of an inventory system was often too much to handle. For this series I really tried to balance an adaptable, powerful system, while only introducing a handful of different coding patterns. That said, if you are comfortable with using inheritance, it will probably pay dividends in the future by making your code more maintainable.

    • @realmcraftchronicles
      @realmcraftchronicles 17 днів тому

      @@NightRunStudio Thanks for the advice. I have been piecing together tutorials from various channels to create something of a game. The thing that is the worst is, getting really far and then having to restart because there is a better way. I was creating a Quest system based off your dialogue manager and someone else's quest system. I tried to use an npcquestpoint class that was inheriting from a questpoint class. There were so many issues that I decided to go in a different direction. I wasnt sure if it was my lack of understanding, or the fact im on a MacBook air, or what the issue was. I'm going to upload my first video tomorrow.

    • @NightRunStudio
      @NightRunStudio 17 днів тому

      @@realmcraftchronicles It's always tricky... on the one hand, you keep learning better ways to do things, and want to start over to make your code more maintainable... but then there's also the fact that you could just do that infinitely. The trick is knowing when there's enough bang for your buck to make starting over worth it, and when you should just keep going so that you don't just end up in an infinite loop of restarting. (I'm saying this as the guy who just started rebuilding his game 2 months ago... hopefully for the last time this time!).

  • @repcattds8189
    @repcattds8189 17 днів тому

    Hey, Tysm, for the code; it helped me so much! However, I am wondering if I could make a chase limit for the enemies.

  • @repcattds8189
    @repcattds8189 17 днів тому

    Hey what do I do if my character just floats on the enemy hitbox?

    • @NightRunStudio
      @NightRunStudio 17 днів тому

      Is he dealing damage, but then floating afterwards, or is he failing to deal damage at all? If it's the former, then you probably just need to add some knockback effect so the enemy is repelled after you hit him. If it's the latter, then it sounds like your OnCollision method isn't firing properly. I would try adding some debug.Log messages (ex., Debug.Log("Test"); so you can find out which lines of code are firing and which ones are not. I would first ask 1) is the OnCollision method being triggered at all? 2) is it recognizing that the player has entered the enemy collider? Hope that points you in the right direction.

  • @NoradNoxtus
    @NoradNoxtus 17 днів тому

    private void ChangeState(EnemyState state) { enemyState = state; anim.SetBool("Idle", state == EnemyState.Idle); anim.SetBool("Chasing", state == EnemyState.Chasing); } helps with adding more states without the method ballooning! :D

  • @aveefirestorm4182
    @aveefirestorm4182 18 днів тому

    Very useful, thank you!

    • @NightRunStudio
      @NightRunStudio 18 днів тому

      Glad to hear it! Thanks for the comment.

  • @Oleanderthe_octopuse
    @Oleanderthe_octopuse 19 днів тому

    Could you make a quest system tutorial for this dialogue system? My brain hurts from trying to figure this out for myself.

    • @NightRunStudio
      @NightRunStudio 19 днів тому

      I’m toying with the idea of a quest and dialogue system for my RPG series, so this is definitely a possibility if there’s enough interest.

  • @the_smiling_child
    @the_smiling_child 19 днів тому

    Hi, I have a problem, I setted up the e buton but it doesn't work

    • @NightRunStudio
      @NightRunStudio 19 днів тому

      Which spot did you put it in the input manager?

    • @the_smiling_child
      @the_smiling_child 19 днів тому

      @NightRunStudio InventoryMenu

    • @NightRunStudio
      @NightRunStudio 19 днів тому

      Did you replace an existing button or make a new one? If the button isn’t doing anything, it’s possible you have it set up for a mouse or joystick instead of a key press. That’s one reason I usually suggest using the existing Fire buttons as they are set up properly for key inputs.

    • @the_smiling_child
      @the_smiling_child 19 днів тому

      @NightRunStudio It's made for joystick, thank you

  • @NinjaSquid4EVR
    @NinjaSquid4EVR 20 днів тому

    He’s smovin

  • @SorceressGamelab
    @SorceressGamelab 20 днів тому

    Hi! I'm using your heart system and i was wandering how can i make it so when player picks up an item he will get one additional heart? Do i have to add to max health or do i need to do an additional step? Thank you!

    • @NightRunStudio
      @NightRunStudio 19 днів тому

      The system isn't inherently designed to do this, but you definitely could add that functionality. What you would want to do is: 1) Add all of the hearts that a player could possibly have right from the start. 2) In your Start() method, create a for loop that iterates through all of the empty hearts, turning them on as long as their length is not greater than your maxHealth. 3) The rest of your code would work as normal. 4) Now, whenever you gain maxHP you would want to call the same method you did in Start() so that it can turn on new empty hearts. It's hard to get it across without another tutorial, but hopefully that gets you off on the right foot.

  • @riveracharles4660
    @riveracharles4660 20 днів тому

    Lets gooo 🎉

  • @kamm3021
    @kamm3021 20 днів тому

    Nice 👍🏻 Tarzan on steroids 😂

  • @antongrebinnyi6922
    @antongrebinnyi6922 20 днів тому

    Hi, love your tutorials. There is also a sprite for an enemy that throws dynamite in this asset pack, are you planning to implement it as well? I am interested how to make projectiles fly in a parabolic trajectory and how to make enemy ai understand when there is an obstacle along that trajectory. I have done this for straight flying projectiles with something like raycast, but not sure how to do this for curved trajectory.

    • @NightRunStudio
      @NightRunStudio 20 днів тому

      Thanks for the ideas! I’m not totally sure just how far the series will go, but as long as people are watching I’ll keep adding stuff. More complex enemies are definitely on the horizon!

    • @antongrebinnyi6922
      @antongrebinnyi6922 20 днів тому

      @ Great to hear that!

  • @normalguy2086
    @normalguy2086 20 днів тому

    Best tutorials from the best guy