• 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 xCharlie · Oct 09, 2013 at 08:18 AM · physicseffects

Domino Effect

I'm making a 2D game prototype and I like to make a domino effect using the physics engine. I'm using AddForceAtPosition but I'm not sure if the parameters are correct cause I cannot get the domino effect I want.

alt text

 void FixedUpdate() {
     if (Input.GetButtonDown("Fire1")) {
         domino.rigidbody.AddForceAtPosition(domino.transform.right * 30.0f, domino.transform.position + new Vector3(0, 5.0f, 0));
     }
 }

Rigidbody

 Mass 0.08
 Drag 0
 Angular Drag 0.05
 Use Gravity Yes
 Is Kinematic No
 Freeze Position Z
 Freeze Rotation X, Y

If freeze position Y, I get a better effect (although I want something better than that) but don't apply gravity.

alt text

Thanks for the help

01.gif (109.2 kB)
02.gif (103.9 kB)
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

2 Replies

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

Answer by sed · Oct 09, 2013 at 10:17 AM

Maybe you could get away with just making the blocks thinner?

Set the proportion between height and width to something more like in real domino blocks, and you will see less 'stabilization' after being pushed.

Consider a real world situation: trying to force a cube 1x1x1 (a gaming dice any1?) to fall - it probably won't work as easily as real domino piece.

A real domino piece is more like 1x5x10.

What's more the suggestion from the other answer about switching center of mass makes a lot of sense but it won't help much until you make proportions adequate.

When making physics simulations always try to make sure your Render part is as closely representative to the Simulation part as possible. Then you will be able to 'just see' most of the problems :)

It doesn't matter if you are in 2D or 3D - drawing the simulation accurately helps you 'just see' whats happening.

Side note: You may want to put some thought into the physics to drawing ratio in your game and keep it consistent everywhere. If you simulate block 1x10 as 8pixels x 80 pixels try to keep 1:8 scale in the whole game - this will make your life easier when adding interactions between different elements.

Comment
Add comment · Show 4 · 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 xCharlie · Oct 10, 2013 at 09:32 AM 0
Share

It makes sense that the proportion affects. Right now the size is 1x1x1 and I'm using 16x32 sprites with 2D Toolkit but don't know if that affects anything...

avatar image sed · Oct 10, 2013 at 09:43 AM 0
Share

Add the part about the difference in proportions in simulation vs rendering. It will be more helpful for future readers. This is the apparent problem in your situation :)

avatar image xCharlie · Oct 10, 2013 at 11:01 AM 0
Share

Ok, now I understand it, thanks. But if I'm working in 2D, is there any difference?

avatar image sed · Oct 10, 2013 at 11:18 AM 0
Share

Well, I believe the situation stays the same, it doesn't matter if u r in 2D or 3D, drawing the situation accurately makes it easier to 'debug it by looking how it behaves'. You probably want to draw the 'thin side' of those blocks. So draw them as 8x80 sprites, and you should be ok :)

avatar image
0

Answer by venusboysatish · Oct 09, 2013 at 08:43 AM

do this: increase the y position of ceter of mass of the rigidbody so that they will fall easier. domino. rigidbody.centerOfMass = new Vector3(0f, 0.25f, 0f);

PS: i had made similar game. https://www.facebook.com/TheDomingos

Comment
Add comment · Show 1 · 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 xCharlie · Oct 10, 2013 at 09:31 AM 0
Share

I'm not sure but I don't notice difference using centerOf$$anonymous$$ass. $$anonymous$$aybe there's something to change in Physics $$anonymous$$anager?

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

17 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

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Why is there no LateFixedUpdate event ? 1 Answer

how to create Magnetic repulsion ? 0 Answers

Faux Gravity Prolem? #2 2 Answers

Hooking RigidBody.AddForce 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