Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by cnepoy · May 15, 2015 at 05:40 AM · 2drigidbody2dphysics2dspriterendererhingejoint2d

Create a simple constantly swinging vine/rope

I am trying to recreate this Mario Party 3 minigame. The first thing I want to do is create those swinging vines. I have created a sprite in GIMP and am now trying to make it swing.

My first thought was to simply throw the asset there, put a Hinge Joint 2D at the top of it, rotate it, reduce its angular drag to 0, and let gravity do the rest. Since there is no drag, gravity should be the only force acting on it and the bottom of the vine should oscillate between back and forth, always achieving the height it started at.

This is not what is happening, though. As time goes on, the vine reaches lower and lower heights. What is causing this dampening?

Here is a video I made, which shows a vine at 90 degrees to begin with, but is approaching 45 degrees.

For reference, here is a screenshot of the object (although not at 90 degrees):

alt text

What force could possibly be causing the vine to slow down? Please help

Comment
Add comment · Show 2
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 cnepoy · May 15, 2015 at 02:34 PM 0
Share

Hmm. Interesting. I guess I do not really understand how I could use a spring joint to help simulate a swinging vine. The documentation says that "The Spring Joint joins two Rigidbodies together but allows the distance between them to change as though they were connected by a spring." I only have 1 Rigidbody here (the vine) and I do not really see how swinging from a point could be simulated by a spring.

Could you give me a little more insight as to what you meant?

avatar image yashpal · May 18, 2015 at 05:07 AM 0
Share

@cnepoy, sorry for late replay, i edited my answer.

hope it more clear. and I don't know this is best way of doing this but this is one way.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by yashpal · May 15, 2015 at 06:33 AM

hello @cnepoy,

Try spring joint

spring joint

you might need to change anchor offset position.

Edited:-

image steps

you can attached this spring other gameobject which have rigidbody. (else it is always point to point(0,0,0)).

steps:-

1) Take sprite which you want to use as swing.

2) Attach rigidbody2D , and springJoint2D.

3) set parameter as in image. you need to change anchor and position of sprite.

Hope it helps


swing.png (82.4 kB)
inspector.png (19.6 kB)
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.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Creating a simple swinging vine/rope/line 0 Answers

Remove Drag/Friction 1 Answer

Rigidbody2D is kind of flying instead of falling when the child box is colliding 1 Answer

ForceMode2D.Force not working in fixed update 1 Answer

Unity 2D - Rigidbody2D Velocity sudden freeze 0 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