(Solved) How to create objects (enemies) that create other objects?

Hello, I would like to know how I can make that when enemies appear randomly, each one is created with another object that follows them, this would be the hit box to be able to detect the player.

When you create the Enemy also create the EnemyHitbox then use Link two objects to link Enemy and EnemyHitbox then do
Foreach Enemy
Take into account Linked EnemyHitbox
Set EnemyHitbox x = Enemy.X
Set EnemyHitBox y = EnemyY
So when you move the Enemy the EnemyHitbox will move too

I understood about the coordinates, but I didn’t understand about linking the objects, could you give me a visual example or something? Please.

Would the Sticker extension help in this case?

It helped me, but I want to know how I can randomly appear enemies with another object that would be hit box to detect the player, because when the enemies appear and one detects the player, they all follow the player and I don’t want that. I only want the enemy that sees the player to follow him, and not all of them.

Hi, just check this thread here Creating two or more instances in the same scene, it might help you to connect your randomly created enemies with a hitbox.

Ah, that’s a different kettle of fish.

Give the enemy a boolean instance variable, and set it to true if the enemy spots the player. Then only move the enemies with this variable set to true.

Could you give me a visual example?

Enemy object variable:

Events to move each enemy individually if they have been close enough to the player :

Thank you very much for the help!