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 ratboy · Apr 30, 2012 at 03:43 AM · rigidbodydragkinematichuddrag and drop

Drag area from HUD

Hi, I have a 2d physics game where you drag certain objects from an area on the bottom of the scene into the game, I want it so that obviously at runtime the objects start in this 'HUD' area, and are kinematic, so they don't drop down, but you can drag them up through the ground collider and when they enter this area they become non- kinematic and won't fall back through the ground. I was thinking of having a drag rigid body script, and disabling the collider on each object, and when it enters a trigger area (i.e. the game area above the HUD), the collider is activated, and then the isKinematic = false. However I now realise that drag rigid body scripts don't work with kinematic game objects, and I'm really stumped.. any ideas on how to go about this??

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 Seth-Bergman · Apr 30, 2012 at 05:41 AM 0
Share

if you uncheck "use gravity" it won't drop down. Is there some other reason you wanted it to be kinematic? If you want to ignore the ground, and turn on collision once it's up, you could use a collision layer that ignores the other layers, then change the layer when it's in place to one that sees the rest, as in: GameObject.layer = 10; (or whatever)

avatar image ratboy · Apr 30, 2012 at 06:40 AM 0
Share

Of course, I've always changed the gravity values to 0, so it sort of hovers a bit but wobbles around, thanks a lot. And the layer change will work perfectly, post it as an answer if you want me to mark it up :) thanks a lot Seth.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Seth-Bergman · Apr 30, 2012 at 06:54 AM

if you uncheck "use gravity" it won't drop down. Is there some other reason you wanted it to be kinematic? If you want to ignore the ground, and turn on collision once it's up, you could use a collision layer that ignores the other layers, then change the layer when it's in place to one that sees the rest, as in: GameObject.layer = 10; (or whatever)

Edit: Sure thing.. in case there is still any such wobble issue, you could always leave it as kinematic until being clicked/touched.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to stop Kinematic Rigidbody from moving through walls 2 Answers

Deactivate Rigibodies 1 Answer

Can I have a rigidbody continue to calculate physics while being dragged by code? 2 Answers

Drag rigidbody.js help 0 Answers

How to influence the direction of an falling object by dragging? 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