About contact between child objects with follow settings and tiles

I want to make a child object that follows the player and a child object that follows the enemy collide with each other, but no matter how I set the layers or masks, they pass through each other.

Can child objects that follow each other not collide?

Also, when a child object is set to follow without separation, can it not interact with tiles?

The wall collision detection in Action Game Maker is extremely fragile. Objects easily get pushed into walls or buried in the ground when colliding at high speed. It’s much more fragile compared to RPG Maker MV. Even when gently pushed against a wall, the pushed object passes through it. Enemies that are knocked into a wall don’t get caught and fall down when they land.

So I thought about using a larger collision object as a cushion, but is that also impossible?

When the parent object gets stuck, escape options are very limited. This is especially difficult to control when the object is not the player character.

If there are any settings or alternatives to prevent objects from easily getting stuck in walls, I would appreciate your advice. Thank you.

On the ChildSettings of the child object have you tried using the ‘Near’ follow type option?

Dear PIero,

The wall collision detection in Action Game Maker is very fragile; objects can easily get stuck in walls or the ground when pushed against walls or hit at high speed.
It’s significantly more fragile compared to Action MV. Even when gently pushing an object against a wall, it can get pushed through the wall. Similarly, enemy objects that are knocked into a wall don’t get caught and fall down properly during descent.

We believe resolving this issue should be our top priority, so we’d like to confirm the following:

The wall collision system in Action Game Maker directly utilizes the robust collision system from the Godot Engine, making the kind of behavior you’ve described highly unlikely under normal circumstances.

There may be an issue we’ve overlooked, or possibly you’re using Action MV, and you might be applying movement methods—such as directly adjusting position—that bypass Godot’s collision system.

If possible, could you share the project where this issue occurs?

Thank you for your reply. I have set it to always follow the parent, but when another object pushes an object that doesn’t touch the tile against the wall, it gets stuck. I think I’ve managed to solve it by changing the settings. Thank you.

Thank you for your reply.

In my current setup, enemy objects are configured as parent objects that only interact with tiles, while their child objects have collision detection that only interacts with the player. However, when the player is pushed against a wall by multiple enemies, they sometimes pass through the enemies. For now, I am mitigating this issue by placing objects with large collision areas near walls.

Also, this might be better discussed in a separate thread, but occasionally, for some reason, the “disabled” setting for Attack Collision in animations gets turned off, causing attack detection to appear in animations that should not have it. It does not appear in debug collision displays, and I have “disabled” enabled for all non-attack animations. However, once this occurs, simply walking toward an enemy continuously deals damage. In my project, this tends to happen frequently when the player takes damage. There may be something I’ve overlooked, but it could also be a bug, so I’d appreciate it if you could briefly check this as well.

Additionally, I am currently firing hit marks as projectiles from enemies when they are hit, but this is extremely heavy on performance. When multiple enemies emit hit marks simultaneously, my PC freezes for nearly a second. I understand that Action Game Maker struggles with spawning multiple objects simultaneously within a single frame, but this severely limits the scope of games I can create. I would be grateful if this could be addressed in the future.

How should I send you my project data?

Thank you for your report.
GUILD has a DM sending feature, so please click on my icon and send a message from there.
Since the project file may be large, I would appreciate it if you could use a file-sharing service such as GigaFile便 to send it to me.

Thank you for the project data!

I have a question as I proceed with my investigation: What is the reason for dividing the enemy wall collision detection into two types—parent object and child object? I assume this is done to address something that cannot be achieved with the wall collision detection of the parent object alone. Thank you for your help.

Normally, the wall collision of the player and enemy’s child objects will make contact, but during dashing through or when enemies are falling, we want to avoid contact, so we temporarily disable only the child’s wall collision at those times. (Note: This is still in early development, and some settings are not yet fully configured.)

The parent enemy’s wall collision only interacts with tiles. When the parent’s HP reaches 0, the child also disappears.

Conversely, if we instead assign wall collision to the player’s child objects (rather than enemies), the frequency of wall penetration significantly decreases. However, since we cannot control the presence or absence of wall collision for individual enemies at specific timings, this approach limits our design flexibility.

If we could dynamically switch collision layer masks using variables or similar methods, we might be able to resolve this issue without using child objects—but since it’s unclear whether such functionality is even possible, we are currently proceeding with this method.

First, regarding the issue of objects sinking into each other, it is highly likely that the problem lies in the collision layer/mask settings.

In Godot’s collision system, unless one object is stationary, it is generally recommended to configure layers/masks so that collisions occur bidirectionally.

In your project, the settings were as follows:

  • Tile: Layer 1,2,3,9,12; Mask 9
  • Enemy (main body): No layer; Mask 3
  • Enemy (child object): Layer 1,9,12; Mask 9,12
  • Player: Layer 1; Mask 9

The issue where enemies sink into walls occurs because, while the enemy → tile collision triggers (mask 3 vs. layer 3), the tile → enemy collision does not occur since the enemy has no assigned layer. Consequently, the tile cannot generate a repelling force against the enemy, causing the enemy to pass through.

Regarding the issue where the player sinks into walls when sandwiched between enemies, this appears related to the use of child objects and the above configuration. Since the enemy’s main body cannot detect the player, it does not collide with the player and attempts to pass through. However, the enemy’s child object does collide with the player, causing the main enemy body to attempt to follow and push the player. Yet, since the tile only has mask 9 set, it cannot generate a repelling force against the player.

As a result, the player gets pushed by the child object trying to resolve the overlap, ultimately causing the player to sink into the wall.

As a solution, I recommend configuring the layer/mask settings so that “enemy main body” ↔ “tile” and “player” ↔ “tile” can collide mutually.

Additionally, regarding:

The “Attack Collision” disabled setting is turned on, causing attack detection to trigger during animations that should not have attack detection.

Upon checking, I found that in InvincibleSettings, the property “Change hitbox to attack box during invincibility” was enabled. This is likely the cause.

It is inappropriate for this setting to be enabled by default. I will report this to the development team to change the default value to disabled.

Thank you for your attention.

Thank you for your reply.
I now understand the attack detection during invincibility. Thank you for explaining.

Regarding wall collision detection, I want to ensure that enemy objects never touch each other, so I set it up as follows, but the result hasn’t changed:

Tiles: Layer 1, 2, 3 Mask 1, 2, 3
Enemy (main object): Layer 2 Mask 3
Enemy (child object): Layer 1 Mask 1
Player: Layer 1 Mask 1

Is there something wrong with my settings?
Or should I assume that child objects following a parent on a different layer will still be pushed into the layer when blocked?

Or should I assume that the child object layer, which follows a parent layer of a different layer, will be considered “stuck” when pushed?

I haven’t looked closely at the implementation, but I think it’s safer to assume that it will be considered “stuck.”

The reason is that the implementation of “staying close and following” likely involves teleporting the child object to the parent’s position every frame. In such a case, normally, collision would result in both objects pushing each other apart. However, when pushed apart, the child object would immediately teleport back to the position where it was “stuck,” causing the player to be pushed again. This would result in the player being pushed continuously in one direction.

To avoid this issue, you can prevent the player from colliding with the enemy (child object) by using a mask, as shown below:

  • Tile: Layer 1, Mask 1, 2, 3
  • Enemy (main body): Layer 3, Mask 1
  • Enemy (child object): Layer 3, Mask 2
  • Player: Layer 2, Mask 1

However, if you want to implement the player being pushed by the enemy, you might need to implement wall collision without using a child object.

Depending on what you’re trying to achieve by separating wall collision between the parent and child objects, I might be able to offer better advice. If you could share more details, I’d appreciate it.

Sorry, I tried it, but if I’m not mistaken, with this setting, the player and enemies won’t collide at all, so there’s no reason to attach a child object.

As I mentioned briefly at the beginning, the player and enemies normally have collision detection, but during specific actions like dashing, they should be able to pass through each other (only during that moment, the enemy’s child object is temporarily made wall-less). However, even during passing through, the enemy must always have collision detection with tiles.

In other words, I want to prepare two types of wall collision detection:

  • Collision detection with the player,
  • Collision detection with tiles only.

And I want to control when each collision detection is active separately.

Since this is a melee combat action, without collision detection, attacks that move forward significantly or combos would allow the player to pass through enemies. If I disable the main object’s collision detection, there’s a risk of passing through tiles or falling off the screen. This isn’t a typical jump action—it’s more like a fighting game system.

You might ask, “Why make such a strange system? Can’t they just jump over or shoot projectiles instead?” But I can only say that’s the kind of game I want to make.

Is there a way to attach two types of collision detection to a single object without using child objects, by setting different layers and masks? If not, I’ll probably implement a workaround, such as attaching walls to the player side and making them warp back to a fixed position when they get stuck in tiles. Sorry for the long explanation.

I see, so the goal is to allow the player to pass through enemies only during specific actions. In that case, during the relevant action, could we temporarily change the CollisionMask by setting the player’s own GameObject node using “Change Property” or “Object Property” so that it doesn’t collide with anything except tiles?

Normally:

  • Tiles: Layer 1, Mask 1, 2, 3, 4
  • Player: Layer 2, 4, Mask 1, 3
  • Enemy: Layer 3, Mask 1, 2

During the pass-through action:

  • Player: Layer 4, Mask 1

This way, enemies won’t collide with each other, and the player and enemies will normally interact but won’t collide during the pass-through action, right?

It seems to be working well with the method you taught me! Thank you very much.

I could see that it was very well crafted, so I’m glad it was resolved successfully! While ACTION GAME MAKER can do many things compared to ACTIVEMV, there are significant differences in how it works, and some information is limited. If you encounter any difficulties, please feel free to ask in the RPG MAKER GUILD or DISCORD communities.

1 Like