Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Running on a ball like a circus bear?

Discussion in 'Animation' started by Shobosa, Oct 16, 2020.

  1. Shobosa

    Shobosa

    Joined:
    Jul 8, 2015
    Posts:
    18
    I am having trouble getting this function to work in Unity 3d. I am trying (and failing) to set up an avatar that runs on a ball during game play. I have tried to make the person main object and the ball a child but the running animation doesn't effect the ball. Would it be better to make the whole object ball and person one object in the scene? Anyone that has a helpful tip or a tutorial that will give me my answer.

    Ball_Runner.PNG
     
  2. VishwasGagrani

    VishwasGagrani

    Joined:
    May 12, 2018
    Posts:
    72
    Have you added the code for the rotation of the ball?
     
  3. Shobosa

    Shobosa

    Joined:
    Jul 8, 2015
    Posts:
    18
    I have, but it just makes the whole object rotate and not just the ball. I am trying to get the person staying balanced on top of the ball while the ball spins
     
  4. VishwasGagrani

    VishwasGagrani

    Joined:
    May 12, 2018
    Posts:
    72
    Making it balance using physics will be very tedious. Instead you can make it look like it is balancing.
    1. Make the ball and person a child of empty game object.
    2. Attach the rotation script only to the ball. This won't rotate the person-game-object.
    3. Update the position of the parent-game-object. That will move the ball as well as the person-game-object. And will look as if the person is moving on the ball while it's rotating
     
unityunity