- Home /
Help with making special attacks?
Hello guys. I'm having a bit of problem with making my special attack system for my game. I want to make 3-4 different special attacks for my game (the player can choose which one to use by holding the right trigger) When the player press the left trigger (which is the button to execute the special attack), each special attack will work differently in someway (one attack works in an area of effect, other is a projectile, other is a continuous laser attack with aim, etc.), but I don't know how to do it. Can someone give me a light here on what to do? (Also, I'm using the new Input System).
This is quite a big question, I think you might be struggling because of how much there is to think about here!
The good news is we can break this down into bitesize chunks of functionality. If I were you I'd start by writing some of the other attacks. Just for debugging, find the place where you trigger your regular attack, comment that out and replace it with a similar call to start your new attack and adapt from there.
For both the area effect and projectile you'll probably want to have a look into Physics.SphereCastAll()
to find the enemies within a given area to receive damage.
Once you have several attacks, you can then write the code to allow the user to decide which to use.
Didn't think I should put this as an answer since I'm not giving you a solution, I don't expect you'll get many answers since this is quite broad. Start down a path and post again when you run into issues there, feel free to tag me in them :)
Your answer
Follow this Question
Related Questions
Is there a way to do different things depending on whether the button is being held or tapped? 2 Answers
Different attacks using same keybindings? 2 Answers
how to make 2D platformer AI for a skeleton 0 Answers
Script problem : beat'em up 0 Answers
how to make an AI damage a third person controller ? 1 Answer