I would like to place an object in the middle between two separate objects (C object to align to the middle between A and B objects)
The C object should be placed in the middle of the A and B objects but remain on its X axis
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
Select the 2 objects, hit Shift+S for Snap pie menu and choose Cursor to Selected
Select the "C" objects, hit Shift+S for Snap pie menu and choose Selection to Cursor.
You can also use snapping during transform operation. There are quite a few settings/options to set for snapping in Blender:
Transform Pivot is usually important, but in our case it's only important that it is set to anything but not 3d Cursor. I set the Snap To Vertex mode, because I feel like that's going to be most convenient, and Snap With Center, Median and Active would all work in this case. I don't like to leave snapping enabled, so I am going to leave it off and just hold Ctrl to temporarily enable snapping during my transform operation.
So what one can do is enter grab operation with G, constrain the operation to some axis - Y in my case and start snapping with Ctrl down. Once I see a snap point, I can press A to add a snap point, this is where it gets awkward with holding Ctrl down, because pressing A doesn't do anything with Ctrl in this case, so I have to temporarily release Ctrl to press A. It's nicer if you enable snapping fully, but I don't like to do that, so I just got used to this awkwardness. Here is the GIF:
Snap points are averaged. So you could also make the same point have more weight by hitting A multiple times while hovering over it. So if I hit A twice for the first vert instead of once, Suzanne would snap to 1 third of the way from the first vert to the second one.
Snapping has loads of options, see them explained in the Manual in detail.
If you want this object to remain equidistant between the two even during movement/animation, go ahead and place it roughly where it needs to be and then add two object constraints under Object Constraint Properties > Copy Location and set the target for each to one of the other objects (A or B in your example) that you want the center object to be between. Then set the influence for each constraint to a value that produces the desired results (probably somewhere around 0.5). You can also specify particular axis if necessary.
It's not mathematically perfect, but its the easiest way to force your object to stay between the other two.