Object 1 can move up, down, left, and right (by pressing WSAD or the up, down, left, and right arrow keys).
Sub-object 2 can be directly attached below Object 1, or it can follow Object 1.
Using Object 1’s script, generate Object 2 after one second (already set: the generated object is a child object).
BUG occurs: (1) The newly generated Object 2 cannot follow Object 1; (2) As a collateral bug, the scale of the newly generated Object 2 is inconsistent with that of the original Object 2 directly attached to Object 1.
Explanation: I wanted to facilitate weapon switching, so I didn’t want to directly attach a child object of a weapon below the player. Instead, I wanted to attach a weapon generation box, and then let the script of the weapon generation box freely choose the weapon to be attached. However, due to this bug, this function cannot be implemented.
AGM child objects are merely an abstract relationship. They allow the object to be selected as a “child object” target in other actions. If you wish to dynamically generate objects under a specific object, consider using the ObjectMountTarget node as the mount point for the generation action.
Thanks to JUSTUS’s help, I have fully utilized the ObjectMountTarget node function to achieve the ability to generate synchronized following child objects using events. Specific practical steps are as follows:
In the target object’s scene (in my case, Object Scene 1), press Ctrl+A to generate an ObjectMountTarget child node.
Open the child node, and in the inspector on the right, there is an option labeled “Mount ID”. Enter the ID name there. The name I used is “Weapon System”.
Then, in the event for generating an object for this object, first select to generate the target object scene 2, and then in the “Generation Position” column, select: SPE_MOUNT_ID. In the option below for attaching an ID, fill in “Weapon System”.
The change effect discovered during game play:
(1) After 1 second, the generated object 2 can move along with object 1.
(2) The proportion of generated objects has also returned to normal.