I have an angle (direction) and I need to move a rectangle in that direction. This is the code I have so far where `pos` is a rectangle and `dir` is the direction:
pos.x += Time.deltaTime * 500 * Mathf.Cos(dir);
pos.y += Time.deltaTime * 500 * Mathf.Sin(dir);
When I run it the object goes off in a random direction!
Edit:
I guess this was not clear: dir is a float and pos is a Rect.