0
Answered

Attacks from different angles

mcyp 3 months ago in Melee updated by Marti (Lead Developer) 2 months ago 3

Hi,

I'd like to ask for...not as much of a question and more of an advice. I have all the game creator modules and I'm trying to create a combat system with multiple enemies attacking the player at once. Most of what I wanted to do works, only one thing remains. 

Right now, the enemies are swarming the player's position but only from the front and when there are more than 2 enemies, the others are standing behind them and are unable to reach the player. Is there a way to make them attack the player from multiple angles?

And when I'm writing this, I have a second question. Is there a way to make the enemies ignore the hits from each other? I want them to be able to attack the player and receive attacks from the player but, at the same time, being unable to hit each other. Not damage wise, cause I have that, but more so the "hit effect" animations. Their weapons need to cause the player to stagger but not the other enemies. 

I'm not good at explaining to I hope you understood me. 

Unity version:
2019.4.0f
Game Creator version:
1.1.9
Answered

Unfortunately I discarded the idea of being able to have different hit reactions for different angles. It made the whole system too complex and required to have too many animations.

Regarding ignoring hits from other characters, you can place all your "team" characters inside a layer mask, which can be used to ignore team-characters when trying to hit enemies.

This is defined inside the Weapon asset, in the Layer Mask field.

I'll try the thing about ignoring the hits (thank you for the idea) but I think we misunderstood each other about the first question.

I don't really need different hit reactions for different angles, that is okay as it is :)

What I wanted is for enemies to not just charge straight on the player and, instead, circle around - so that they will be able to strike from his side or from behind. You know, like in an arena of sort where multiple enemies circle around the player and hit him from different positions. 

Also, another thing. We built an empty project with no actions or anything on the PlayStation 4 and we get a following error:

"'GameCreator.Core.Singleton`1:: OnRuntimeStartSingleton' for which no ahead of time (AOT) code was generated." 


Is there something or some options that needs to be changed when making build for the PlayStation 4?

In that case, the easiest way to do so would be placing empty game objects around the player and parent them to the Player, and offsetting them by a certain distance. This will make these empty game objects follow the player but surround them from a certain distance.

Now you can create a List Variables and add all these empty game objects there. When you want multiple enemies to surround the player, you can pick a random empty game object as the target position and the enemies will randomly spread around the player. Using a Follow Character action would work best, in my opinion.

Regarding the error that appears, it's a known bug and I'm looking into it. Some AOT platforms (iOS, PS4, ...) do not like generic virtual methods, and can't generate the C++ counterpart code. A fix is on its way and should automatically work on the (hopefully) next update.