How to link Player and Bullet

How do I…

Make Player1 shoot Bullet1
Make Player2 shoot Bullet2

Without using if condition for each player, as I will have many different players.

What is the expected result

Dynamic action that will shoot a Bullet based on active Player

What is the actual result

No bullet is shot

Related screenshots

image

Player has Fire bullet extension behavior.
Variable char of Bullets holds text of Player Name (Bullet1 has Player1 etc).
I also tried adding bullet name variable to the Player objects but no luck.
Can this also be done with object linking? And how? What is the better approach?

Many thanks!

Bump

note: Bullets is an object group with Bullet1, Bullet2… and Chars is object group with Player1, Player2…

uhm…why not assign a var identifying each player…?

i mean…you’re assigning char to bullet…i guess u should do it for player…i dunno

…also if you dont want to use for each…the alternative is to create or assign a different bullet per player by var or by object

@RMDB I also tried assigning bullets to player but no luck.
Each Player object has var bullet with value of bullet object name

The only workaround I found so far is to use one Bullet object, and change its skin (animation#, sprite) by the Player that is shooting it

You can’t directly reference the bullet that was just fired.

A solution is to modify the Fire Bullets extension to include a parameter (pass a unique player ID) that assigns the unique player ID to each bullet when it’s created.