-2

I was wondering if anyone knows the best way to get a 2d sprite to go around in a clockwise or anti clockwise motion around the screen edges in Unity? (Snake like motion)

I have looked at ways of determining the screen size but in terms of a actually getting my sprite moving I am out of luck.

taiomi
  • 31
  • 4
  • Honestly there's like a zillion posts; samples; and articles on Unity3D not to mention the bizillions on YouTube –  Jan 03 '17 at 02:41

1 Answers1

0

getting my sprite moving

Update() {
    var target = new Vector3(10, 10, 0);
    transform.position = Vector3.Lerp(transform.position, target, Time.deltaTime);
}

This will move your object to the position (10, 10, 0) over time. But, like the comment said, there are a gazillion tutorials that can help you more, and this will also improve your Google Fu.

Fredrik Schön
  • 4,888
  • 1
  • 21
  • 32