This is kinda hard to explain.
I have a gameObject that, when the B Key is pressed, generates two targets as Empty gameObjects. One target (bTarget) is directly beneath it whilst the other (specialTarget) is in front by 10 along the X axis.
The gameObject proceeds to move towards specialTarget along X, once it reaches it, the specialTarget moves back to the bTarget and both are destroyed when the gameObject reaches them. So basically it’s a straight-line boomerang.
I have it set up and the targets will work if the Object is facing up the X Axis, but when it turns to look down the X Axis, the specialTarget appears where it would if I had faced right/up the X Axis.
I think I’ve isolated the problem code;
specialTarget.transform.rotation = targetB.transform.rotation;
specialTarget.transform.position = new Vector3 (targetB.transform.position.x += 10f, targetB.transform.position.y, targetB.transform.position.z);
Like I said, I think the problem is the new Vector 3 but I’m not sure how to get it to position it 10 forward from my targetB.