Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
1
Question by Disaster · Oct 18, 2010 at 08:45 PM · collisionphysicsfreezepause

How can I make my physics objects stay frozen (eg in mid-air) until touched by another object?

I have a bunch of cube objects in my scene, they have rigidbodys but are set to isKinematic = true.

When the player touches one of these blocks, I want to 'awaken' this block (set isKinematic = false so the block then responds to physics) and at the same time 'awaken' any other blocks which are touching it.

At first I tried doing this with collision detection but it's very buggy and occasionally doesn't work... so I'm trying to think of a more reliable solution. Since the setup is 2D, I was thinking that perhaps I could cast 4 rays, up down left and right, and if those rays collide with another other 'blocks', awaken them too.

I was wondering a) If there is a faster, more performance friendly way of achieving this and b) Is there a way the blocks can listen for Ray hits from other blocks?

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
2
Best Answer

Answer by duck · Oct 18, 2010 at 09:32 PM

What's the purpose of these blocks being set to isKinematic = true in the first place?

If it is solely so that they remain still (eg, suspended in the air) without physics acting on them, you can use the Sleep() function instead (put it in their Awake/Start function so that they sleep immediately on loading). This means that as soon as they are touched by an active physics object, they will awaken and begin to act as a normal physics object.

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 Disaster · Oct 18, 2010 at 09:51 PM 0
Share

This is almost perfect, is there anyway to tell when a rigidbody is then subsequently awoken?

avatar image duck ♦♦ · Oct 18, 2010 at 10:10 PM 0
Share

you could use the OnCollisionEnter function for that, probably!

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

No one has followed this question yet.

Related Questions

Physics explosion when pausing during collision 1 Answer

How to disable pausing on main menu drop down? 0 Answers

How to make physics collision dotted simulation like bubble shooter ? 2 Answers

Very simple collision death 1 Answer

FIXED: How can I stop a collider from tunneling? 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