• Godot Help
  • How to get the highest value in a vector3?

Hi,

I just figured out how to get the "position" in the vector with the highest value, but I actually want to get the highest value. How is that possible?

  • Here you go:

    var c = Vector3(42,14,87)
    var m = max(c.x,c.y,c.z)

With "value", do you mean the length of the vector ?
And how many vectors are there and how often does this happen ?

    Here you go:

    var c = Vector3(42,14,87)
    var m = max(c.x,c.y,c.z)