• 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 /
avatar image
0
Question by tren · Apr 08, 2011 at 12:02 PM · snake

snake game revisit, some doubts in it in joints

Is it possible to use hinge joint between two spheres, i tried of that but its not working. But it is working in between sphere and cylinder. Can any one tell me how two do that. And the body parts are moving with the head but they are not turning around.

Comment
Add comment · Show 3
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
avatar image AngryOldMan · Apr 08, 2011 at 12:05 PM 0
Share

Double up on the hinje joints, ie connect a hinje joint to another hinje joint, or attach the two hinje joints to an invisible/emtpy game object

avatar image Proclyon · Apr 08, 2011 at 12:18 PM 0
Share

Why build a snake with sphere components? Isn't cylinder somewhat more logical?

avatar image Statement · Apr 08, 2011 at 01:16 PM 0
Share

@Proclyon, maybe OP wants to make a snake that looks like John Candy? :)

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Jean-Fabre · Apr 08, 2011 at 02:16 PM

Hi,

The shape of the mesh you apply joints to shouldn't affect it so much.

I usually only rely on configurable joints, to build a "hinge" joint, it gives you more options and flexibility. If using a configurable joint doesn't work, make a comment, and I'll post a small working example.

Bye,

Jean

Comment
Add comment · Share
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
avatar image
0

Answer by Owen-Reynolds · Apr 08, 2011 at 02:21 PM

Check the axis of hinge rotation. It starts as (1,0,0). If sphere #2 is behind #1, that will make it hinge up/down. If #2 is next to #1, it will hinge by twisting, which you won't even see on a sphere. Try (0,1,0), meaning it hinges around a straight up line, like a door. When you click in the Inspector, the orange arrow shows the hinge axis.

To test, try manually pulling the first one in scene view while running. If needed, select sphere #2 and check the rotation.

Adjust the anchor numbers, as well. It starts at (0, 0.5, 0) which effectively gives a center to center connection (#2 will appear to "roll around" #1.) Changing x or z would give a "glued to the side" effect. The orange Inspector arrow also shows this position.

FYI, you don't have to have two 0's and a 1. (0,65,0) is also straight up. (1,0,1) hinges around a line drawn NE.

If you have a 3D snake, where the top can go L/R or up/down hills, a characterJoint might be better.

Comment
Add comment · Share
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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

snake game revisit, some doubts in it 1 Answer

Converting screen coordinates to world coordinates 1 Answer

Snake/Chain Collide with self or other rigid bodies 0 Answers

Allow collision but take no force from it, not increasing object mass 1 Answer

I want my snake to move continuosly if i press...up it should move up until i press another button....like the original snake game 2 Answers


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