// Update is called once per frame void Update() { var dataStr = serial.GetData(); if (dataStr == null) { return; } var aaaa = dataStr.Split('a'); Debug.Log(aaaa); data[0] = float.Parse(aaaa[0]); data[1] = float.Parse(aaaa[1]); }