instantiate

How to instantiate walls between pillars.First instantiate walls between A and B and then instantiate Band C and then between C and D .I want o use a single wall between A and B .I have a two pillar A and B i want to instantiate a wall between A and B .Player can change the position of the pillar A and B then the new wall should adjust according to that new position of the pilar.

i’m not quite sure what you’re trying to do , maybe your existing try would’ve helped to figure it out but … you could use this to make a wall between 2 pillars

Vector3 A = pillarA.transform.position;
Vector3 B= pillarB.transform.position;

wall.transfor.position = B + ( A -B ) / 2;