Setting an object's position to another objects' without parenting or following

Simply setting transform.position to the other transform’s position makes it always the same position, no matter how many variations I tried. I tried storing the position of the second object in a separate Vector 3, in separate floats corresponding to the coordinates and a few others. How can I just extract the second object’s position at the moment and place the first transform onto that position?

I personally find your post slightly confusing. You want ObjectA to be at ObjectB’s position but
ObjectA.transform.position = ObjectB.transform.position; isn’t what you want?

Sorry, should have clarified it a bit more. Whenever I try a simple ObjectA.transform.position = ObjectB.transform.position, ObjectA’s position starts to follow ObjectB’s no matter what. I’d like to make it so ObjectA gets moved to ObjectB’s position, but after that I can freely move ObjectA without moving ObjectB.

Can you post your code?

Without parenting the two objects, then assigning the position to another position should only occur once. Now, if you run it in every frame in Update, it’ll execute every single frame and feel like it has been parented.

Oh yeah I was dumb and was constantly calling it in the update. That explains a lot. Thanks for the help!