How can I tell the height of a cylinder?

or any game object for that matter. I have a flag on a pole. The pole is a cylinder. I know the scale of the cylinder, but I do not know the height. I will be changing the “Y” value of the flag that is attached to the pole by incrementing the “Y” value of the flag over time but want it to stop at the top of the pole. The “Y” value of the pole will be different for many of the Flag/Pole groups I will have in the game since the terrain is not flat. A pole on the top of a mountain will have a larger “Y” value then a pole on the ground. So I have to make sure the flag’s change in height does not exceed the height of the pole.

I can say that from my understanding
the pole transform.position.y for every pole u have will be different since u have many of them on different elevations on your terrain
and as I guess it is the same pole model, then all of them have the same height but according to your placement then they all have different transform.position.y
so for the flag u just use your pole.transform.position.y and add a value to it which can’t be more than its height
something like this
flag.transform.position.y + ( the increase amount ) must be less than < pole.transform.position.y + pole height

ofc u know the pole height from the cylinder scale that u already know

sorry if I misunderstood

Use one of the Bounds functions.
If you parent the flag to the pole, the y values will always be the same, in the pole’s local space.