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 Meral · Feb 08, 2015 at 12:59 PM · physics2djointsropegrappling gunswing

2D Platforme Rope

Hi I´ve been trying to implement a rope/grappling system in a unity 2d game. The Player is supposed to shoot a rope and swing from one wall to another. For this purpose i shoot an object with a line renderer for the visuals and once it hits a wall i enable a distance joint (between object and player) for the "physics". Now the basics of swinging etc. work, but it doesn´t really behave like a rope. These are some of the problems:

  1. Gravity doesn´t work properly. the player is not pulled down at all, and it looks really strange when your standing suspended in mid-air at 45° as if the rope is some kind of stick :-)

  2. It is possible to stand on the rope if you shoot it under yourself.

  3. I can change the direction of my Swing in mid-air without any kind of delay

Now i am not entirely sure how i can fix this. I had the idea of generating a rope consisting of many joints dependant on the distance to a wall etc. but i don´t know how to do this. How could i make it behave like i want it to.

Thanks in advance for all answers

P.S.: Sry if this question seems a bit vague

EDIT: Problem 2 has been solved. Problem 1 is the worst one. How can i make the joint behave more fluently and pull the player down instead of suspending him in the air?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by daneislazy · Feb 08, 2015 at 07:04 PM

You probably want to use a HingeJoint2D instead. Set the Anchor position to where you want the rope to attach to in the player's world space, so you can do something like targetPosition - playerPosition to get that. It should work fine with 2D and gravity. You may also want to pre-rotate the player slightly or compensate the rotation as you swing.

As for the changing direction thing, you will probably need to change your movement script to lessen the effects of player input.

Comment
Add comment · Show 2 · 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 Meral · Feb 09, 2015 at 05:30 PM 0
Share

nice, thanks for the answer! i´ll go and give it a try

avatar image Meral · Feb 09, 2015 at 06:34 PM 0
Share

Ok so i tested it and it turned out that part of the character controller was causing the problems. So now everything works fine, even with a distance joint. Thanks for the answer though!

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

20 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

Related Questions

Detect 2D joint break? 1 Answer

How to create a freely swinging "rope" of modifiable size between two rigid bodies? 0 Answers

Snake Movement Like in Snake vs Box 2 Answers

Any way to fix this Spring Joint 2D bug (with video) 0 Answers

How to get ball and chain effect like in SkullChainz? 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