Positioning a part on another part's side

Probably a super basic question here, but how would I position a part like in the picture below?

Not sure what you’re trying to achieve here because there are different methods depending on what you’re trying to do. Are you trying to create a build system? Are you trying to auto-generate parts?

I’m trying to autogenerate something

There’s 2 primary methods.

You can try raycasting and checking the hit position of that raycast, then positioning your part accordingly.

Another way is to use one of Roblox’s built in method, :MoveTo. It has a feature that places an object on top of any obscuring objects.

That’s not really what I’m looking for. I want to place a part on the edge of another part like in the picture I sent.