Trying to make a walking bone structure thing in VR (Unity physics + joints)

So I'm trying to build something in VR. Basically it comes down to creating a thing that can walk around as if the two hand controllers were feet, supporting a head.

I've tried several approaches, the latest one is to have two "bones" that are scaled to their distance from the headset, and joined where the head would be, and copies the rotation too.

Which actually works! Except one problem - it reacts as expected to gravity, which is great. It falls and is on things. If I move the "arms" around, it even jumps. Which is a thing I had trouble with with a previous approach.

But the problem is because it is all done via setting rotation and scaling, it doesn't "walk", or there's no grip - that is, the points that are in contact with the environment glides around.

image

So I added more rigidbodies as "feert" and connected it up to the legs via fixed joints. And it mostly does work as intended, except when scaling the bones, the joint that connects the feet to the bones doesn't move with the bones. I haven't found a way yet to move the connecting point of a joint without freaking physics out.

(I don't have a pic for this cos somehow the build broke and I haven't got it back together yet)

So now I'm trying to find:
1) How to set all the stuff with pure physics without it freaking everything out (I have tried to set the rotation with PID controller type stuff, which seems to freak out because physics is hard)?
2) How to scale and move attached joints without freaking everything out?
3) How to describe this problem more effectively because gosh dang I'm not sure anyone will understand this :/

Like, I just want a thing that lets me walk with physics, tied to the position of hands and head in VR. How hard can this be?!?!??

Thanks for reading!

Comments

  • Hey @Tusim

    So I previously had to work with scaling physics joints and I came across this solution: https://answers.unity.com/questions/1311634/joint-system-scale-problems.html

    It worked quite well for my project which involved plants constantly growing and having physics-based interactions with the environment and player.

    I hope it helps with your current project :D
  • Hey @Tusim

    So I previously had to work with scaling physics joints and I came across this solution: https://answers.unity.com/questions/1311634/joint-system-scale-problems.html

    It worked quite well for my project which involved plants constantly growing and having physics-based interactions with the environment and player.

    I hope it helps with your current project :D
    Hey thanks for this, I've found this on my searches too, but I wasn't able to figure out if it actually figures into my problem - right now when I scale one of the legs, the joint-connected "feet" object remains where it was - it doesn't break off or anything like that. I tried to then manually calculate where the joint should be after a scale event and move the feet object there manually, but that breaks the physics system and the whole thing goes flying around at impossible speeds...

    I'll try to look at it again and see if I can use it...
Sign In or Register to comment.