Object attaches to another object?

Hi!

I don’t really know where to begin with this, so I will give it the best shot I can!

I want to be able to place a flag pole (with a flag obviously) onto a car, with this the user can move the flag around on the car to where the user desires (this is on mobile by the way) but I would like so that one side of the flag pole always stay rooted to the car, even if the flag is on the side or on top. So no matter where the user moves it, it will always stay on the car.

How would I be able to do this?

Assuming that the flag is a prefab, you can set a default y value on its transform to determine how high it should be placed. Whenever a user changes its position, simply create a new Vector3, where x represents the x input and z represents the y input. The y of the transform should remain intact, so that its height remains static.