I’ve noticed I do a fair amount of trivial conversions in blueprints. It would be nice if when I dragged lets say, an object output into a string input that it would automatically insert the ToString node into the graph. Same goes for things like, vector to float.
Im not sure on this one but I couldnt find the default rotator/vector conversion where the result is a unit vector.
We don’t have a separate type for unit vectors versus regular vectors. If you want to normalize a vector to unit length, you can use the Normal node, which normalizes the input vector.
If you mean converting a rotator to a unit vector pointing in the direction of the rotation (exposed as GetRotationXVector), that’s not something we’ll offer as an automatic conversion; it’s ambiguous if that’s what you want, versus wanting to just convert the rotator to a vector with the angles in X,Y,Z, or if you want the X axis of the reference frame or Y or Z axis, etc…
Well in uscript Id do Vector(Rotation) and I dont need to normalize. I guess the ambiguous one is the I want because Ive been using it for 10 years, I have no idea of what GetRotationXVector is meant to mean, is that referring to an element of a structure or is it meant to be a cross? I dont need a full GetAxes set I know that much. I think theres a confusion here between transpose and transform.
To clarify! In Uscript youd have to build the vector to rotation copy manually, I dont see why theres any confusion honestly.
Vector.X = Rotation.Pitch;
Vector.Y = Rotation.Roll;
Vector.Z = Rotation.Yaw;
See the thing with this is each element is seperated as in a MakeVector component (or MakeRotator) each element is converted int->float, float->int separately. Vector(Rotation) is a direct case and each element is fixed in its association.
The confusion arises because there is more than one rotator->vector that can make sense: you can treat it as returning the basis of the x, y, or z axis in that rotation frame, which is useful for building a reference frame, or you can treat it as a straight-up reinterpretation to vector (pitch, roll, yaw). I understand that the latter one is certainly more common, but we’d rather enforce understandability/predictability over simplicity in this case.
TTP 298227 covers a desire to offer a disambiguation menu in cases like this, where both options would be offered.
Also, the conversion from Bool to Int shouldn’t be ambiguous, but it’s not available (I have to go to Int, then to float)
Bool to Int exists, but wasn’t set up as an automatic conversion, and Bool to Float didn’t exist at all. I will add both to the autoconversion list. For now you can use Select Float if you want to go straight from bool to float to pick 0.0 or 1.0f.
Actually int to bool was already present.
Many automated conversions already exist, but we err on the side of caution whenever the desired behavior is ambiguous. For example, would Vector->Float give you the length of the vector or the X component? Object to string is ambiguous as well; it could give you the name, the actor label, some human readable property dump, or the fully qualified path.
I’ve filed a TTP to investigate providing a list of plausible conversions when the choice is ambiguous, rather than no options at all.