Search Unity

2D Egg Roll (Rotate) C#

Discussion in '2D' started by JackNewell14, Jan 26, 2015.

  1. JackNewell14

    JackNewell14

    Joined:
    Jan 26, 2015
    Posts:
    1
    Hey everyone.
    I am looking to move an egg shape over a surface, but I'm not sure if I should be moving the egg or just trying to rotate the egg around itself, as the movement. I have an image of on egg, with a polygon collider on it.
    So basically, I just need help rolling the egg along a surface.

    Any help would be appreciated

    Jack
     

    Attached Files:

  2. PGJ

    PGJ

    Joined:
    Jan 21, 2014
    Posts:
    899
    Just try to add a slight force to it, and see if it rolls the way you expect it to. rigidBody2D.AddForce() is what you want to use...
     
  3. BusyCat

    BusyCat

    Joined:
    Jan 9, 2015
    Posts:
    37
    +1 for @PGJ 's response; I was just going to say the same thing. Question is, 'how much force?' Eggs don't roll so well lengthwise... :)