| Parameter | Description |
|---|---|
| v | The float4 to be converted to a Vector4. |
Vector4 The converted Vector4 result.
// Attach this script to a GameObject. using UnityEngine; using Unity.Mathematics;
public class ExampleFloat4Conversion : MonoBehaviour { void Start() { float4 a = new float4(1f, 2f, 3f, 4f); Debug.Log("Input float4 is: " + a.ToString());
// Implicitly convert Unity.Mathematics.float4 to UnityEngine.Vector4 Vector4 result = a; Debug.Log("Result Vector4 is: " + result.ToString()); } }