Steps:
1 Object 1 can move up, down, left, and right (by pressing WSAD or the up, down, left, and right arrow keys).
2. It can be directly attached to sub-object 2 under object 1, or it can follow object 1.
3. Using the script of Object 1, generate Object 2 after one second (already set: the generated object is a child object)
4 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.
Explain: 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.
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:
Open the child node at 2 o’clock, and in the inspector on the right, there is an option labeled “Mount ID”. Write the ID name in it. The name I used is “Weapon System”.
Then, in the event of 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.