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 elax102 · Apr 03, 2012 at 11:27 PM · gameobjectridgidbodyclicked

Apply ridged body to game object when clicked.

I have an object I want to stay in one spot until clicked on. When the object is clicked on I want it to simply fall to the ground.

I'm pretty sure it's possible to do this through code. However, I only have very little programming experience. I would greatly appreciate any help.

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 syclamoth · Apr 03, 2012 at 11:30 PM

It's possible to do almost anything with code.

In this case, you should put the rigidbodies on the objects to begin with, and set them to 'kinematic' so that they don't respond to physics.

Then, after raycasting to their position (look it up in the scripting reference, I shouldn't have to explain something this basic), set the hit rigidbody.isKinematic to false- allowing it to fall.

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 Owen-Reynolds · Apr 04, 2012 at 03:17 AM 0
Share

is$$anonymous$$inematic is an odd one -- it seems much more natural to enable or disable the RB (but that doesn't work as well) -- and the values seem backwards -- "kinematics" is an army term for lots of stuff flying around, so why does is$$anonymous$$inematic mean frozen?

But, about the coding, yeah. No one asks, "I can't use photoshop, but can you give me some tips on drawing a realistic tiger?" because the advice is obviously to learn photoshop. And program$$anonymous$$g is more difficult than that.

avatar image syclamoth · Apr 04, 2012 at 11:42 AM 0
Share

I disagree- program$$anonymous$$g is much easier than drawing a realistic tiger. I couldn't even hope to draw a shitty tiger, let alone a realistic one!

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

using Contains(gameObject) to find and destroy a gameObject from a list 2 Answers

Character moving weirdly 1 Answer

GameObject stutters when moving if refresh rate is not set to 60hz. 1 Answer

C# Check If Gameobject is within Collider 1 Answer

in-editor cloning of game objects 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