Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by zeroonezeroone · Jan 24, 2018 at 10:53 AM · physicsjointscharacter movementcontrol

How to attach a sphere to an object at a constant relative position, but so that it can be influenced by external physics rotations?

Hi! What the title says, but its not so simple. Basically i have a Player parent object, consisting of 2 main child parts: Body and Legs. Body child and its children are animated and controlled through script and that works fine and since i need the body to be upright, i had it parented to the Player object which is a rigidbody and has frozen X and Z rotations. Legs are connected to the Player by a configurable joint so i cant avoid having rigidbodies on both Legs and Player. The joint is needed so the legs would orient according to the terrain by physics, not rotating the Player (and Body) that needs to be upright.

Now comes the problematic part. I'd like to use the spheres as sorts of all-direction wheels and move the player (who is a kind of a mech) by adding force to them, but i cant seem to connect them in a way that lets spheres keep the fixed position relative to the Legs while simultaneously being able to rotate about themselves by physics in all directions. Configurable joints wont work in this case as the motion becomes too jittery and the position/rotation isnt exactly fixed to a spot despite me setting it so in the inspector. its more like "attached with a spring" even though all spring motion values are zero. more the joints, worse the jitter and more offset.

The only way i got the legs in the right position relative to the terrain and player with the spheres attached is by making the spheres children without rigidbodies or joints, just colliders with a zero friction physic material. but, the spheres arent influenced by physics that way and if i add a rigidbody component they just fall off.

Its not exactly necessary for me to apply forces directly to the spheres, but they should at least be influenced by terrain material (friction), so that rotation speed and orientation match the Player movement on terrain.

Additional info, not sure if related: No rigidbodies are kinematic, but have varying mass values. The Player is the parent of this whole object hierarchy and it rotates horizontally (around Y axis) by a script for a smooth and instant upper body control by touch/mouse, even though it has a rigidbody (with locked X and Z rotations so it is upright, which i also set in LateUpdate because it gets offset from physics interactions after a while). i could attach the script for horiz control to the Body part and animate localRotation if this is an issue, but id rather not because this way Player always faces where the Body faces and i can exchange parts of player through script easily like this.

Any help is appreciated. Thanks for reading through the novel ;)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

180 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I make nonstretchable rope with Configurable Joints?,How do I make non-stretchable Configurable Joint? 0 Answers

BEGINNER: Plane stabilaze issue. 0 Answers

CharacterController bounce on ramp instead of smooth walk 0 Answers

How to set ArticulationBody motion to "limited" in C# 0 Answers

Object sticks to the side of the collider 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges