Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Clone] A little confuse about The Walking Pet's physics simulation

Discussion in 'Physics' started by golemsmk, Aug 20, 2015.

  1. golemsmk

    golemsmk

    Joined:
    Oct 18, 2013
    Posts:
    4
    Hello everyone, now I'm learning Unity by cloning as many games as I can.

    However, when I decide to clone "The Walking Pet", I have a big trouble. The animal's feet can't keep on the ground, and they just slide away, the character just stays at the same position. .

    Any idea how to fix this problem?

    This is my project file. I hope this will make my question is more obvious.

    Thank you very much.
     

    Attached Files:

  2. LunFen

    LunFen

    Joined:
    Mar 11, 2015
    Posts:
    3
    Hi, use rigidbodies2d and hinge joints to connect body and legs. You will need 2 hinge joints 2d on body to connect to legs and one on each leg to connect to body. Also other parts of character must be connected to body with hinge joints maybe use motor to simulate some parts. For legs movement use addtorque. You will need to balance character parts mass.
     
  3. LunFen

    LunFen

    Joined:
    Mar 11, 2015
    Posts:
    3
    And one more thing a forgot: use Physics2D.IgnoreCollision to prevent legs collision!
     
  4. shadowx5

    shadowx5

    Joined:
    Nov 18, 2013
    Posts:
    2
    Hello EveryOne,
    I wanted to start trainning on unity, clonning the pet game is so interesting and challenging, but i'am confused too about balancing the charachter when moving ! if anyOne could help, it would be awesome.
    Thank you !!
     
  5. yubo

    yubo

    Joined:
    Jun 4, 2014
    Posts:
    1
    hello golemsmk ,
    do you have fixed you problem ,i hava the same problem,and i have try the way by alexey but it seems not work