Spawn a Object with Offset to another Object

as the pictures says, im searching an offset point of like 10f between the 2 objects in Vector3.
Im trying for hours searching in the forums, dont find a solution… :frowning:
can anybody help me?
thanks!

If I understand the question correctly, you want to get the direction from one object to another, and then spawn another object in that direction with an offset.

If that’s what you want to do then this might help:

// The offset amount
private float offset = 10.0f;

// References to both objects
private Transform object1;
private Transform object2;

// Reference to object you want to spawn
private GameObject object3;

private void SpawnObject() {
    // Get the direction from object 1 to object 2
    Vector3 direction = object2.position - object1.position;
    
    // Get the position of where the object will spawn
    Vector3 position = object1.position + direction * offset;

    // Spawn the object
    Instantiate(object3, position);
}

Hopefully you can adapt that to better suit your program, but it should work with a few changes.

nice, thank you very much!