Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    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:
    84
    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:
    84
    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