Melee attack that tracks the opponent's horizontal position

Started by DeluxeGamer705, September 15, 2024, 07:56:05 PM

Previous topic - Next topic

DeluxeGamer705

I'm having a bit of a problem with one thing involving tracking.

I'm trying to make a move that tracks the opponent's horizontal position. The thing, though, is that the tracking comes from the character that does an attack that tracks the opponent's horizontal position.

The code I'm using is this:

[State 0, PosSet]
type = PosSet
trigger1 = !time
x = enemy,pos x


The problem here occurs in simul matches. The move only tracks the team leader's position, whiffing if they're K.O.'d as it doesn't start tracking the teammates' positions.

I would really appreciate the help.


Playin' Mugen since 2017, creating content since 2022.

VictorCYBR

Enemy always redirects to the first enemy found. Alternatively, you can use EnemyNear, it redirects to the nearest enemy.
You can even check if the first enemy is alive and then redirect to the second one:

ifelse((enemy, alive), (enemy, pos x), (enemy(1), pos x))

Enemy(1) will redirect to the second enemy found. :P

DeluxeGamer705

Quote from: Lyrica on September 15, 2024, 09:01:16 PM
Enemy always redirects to the first enemy found. Alternatively, you can use EnemyNear, it redirects to the nearest enemy.
You can even check if the first enemy is alive and then redirect to the second one:

ifelse((enemy, alive), (enemy, pos x), (enemy(1), pos x))

Enemy(1) will redirect to the second enemy found. :P

Thanks! It now works as it should. :)


Playin' Mugen since 2017, creating content since 2022.