Is there any way to find a child's relative coordinates to the parent object???
My model ship.3ds is composed of several child entities. I would like bullets to shoot from the location of certain child entities. The only problem is that children entities take on the coordinates of the parent entity.
So when I copy a bullet sprite and name the gun child as its parent, the bullet appears from the center of gun's parent, and not from gun.
So then I tried adding... (b is the bullet type)
The hope was to position the bullet at the true coordinates of gun, but really this just caused the bullet to appear farther and farther away from the ship when I moved it farther from the world center (0,0,0).
There was no chance to succeed. Looking at my debuglog, EntityX(gun,True) was the same value as EntityX(Ship)
I even tried disconnecting the gun child from ship by assigning it nothing as a parent.
But this had the exact same effect as the previous fix. The farther I moved the ship from the world center the farther the bullets began to form away from the ship.
So...
Is there anyway to find a child's relative coordinates to the parent object (via local coordinate system or whatever)???
My model ship.3ds is composed of several child entities. I would like bullets to shoot from the location of certain child entities. The only problem is that children entities take on the coordinates of the parent entity.
So when I copy a bullet sprite and name the gun child as its parent, the bullet appears from the center of gun's parent, and not from gun.
CopyEntity( bullet_sprite, gun ) ; Doesn't work...
So then I tried adding... (b is the bullet type)
PositionEntity b\sprite, EntityX(gun,True), EntityY(gun, True), EntityZ(gun,True)
The hope was to position the bullet at the true coordinates of gun, but really this just caused the bullet to appear farther and farther away from the ship when I moved it farther from the world center (0,0,0).
There was no chance to succeed. Looking at my debuglog, EntityX(gun,True) was the same value as EntityX(Ship)
I even tried disconnecting the gun child from ship by assigning it nothing as a parent.
EntityParent gun, 0
But this had the exact same effect as the previous fix. The farther I moved the ship from the world center the farther the bullets began to form away from the ship.
So...
Is there anyway to find a child's relative coordinates to the parent object (via local coordinate system or whatever)???