Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 TheAwesomeSenpai · Sep 15, 2016 at 11:16 AM · 2d game

Sticking Assets please help.... I am Beginner..

I am a beginner and I am trying to make the 2d catch game , the one with the tutorial however I am using pancakes , so you would catch the pancakes with plate. This is my problem I want the pancakes to stack up without flinging off the plate when I move the plate to catch the pancakes. I know it sounds complicated but how do I make that they wouldn't have gravity applied to them but still move and making the game object one.

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
0

Answer by metalted · Sep 15, 2016 at 11:47 AM

We'll you are right, you make it sound very complicated! And im not really sure what sticking assets mean... did you spill some soda on your keyboard?

I have never heard of the tutorial before, but it looks like you are using a rigidbody to make the pancakes fall out of the sky. Rigidbodies have properties you can set to true or false. To disable the gravity, you can use the rigidbody.useGravity property. You can read more about that here:

https://docs.unity3d.com/ScriptReference/Rigidbody-useGravity.html

You said you wanted to "make the object one". This sounds a lot like parenting. If you make the pancake a child of the whole stack, it will move when the stack moves. You can set a parent with transforms. Lets say we have a stackOPancakes and a pancake transform:

 //Assign these in the inspector
 public GameObject pancake;
 public GameObject stackOPancakes;
 
 void Start(){
     pancake.transform.parent = stackOPancakes.transform;
 }

If you look in the hierarchy, you will see that pancake is now a child of stackOPancakes.

Working with rigidbodies takes some practice. There are a couple of properties you can set and can play around with to get the results you want.

 //Will the rigidbody feel any of the forces?
 rigidbody.isKinematic = true/false;

https://docs.unity3d.com/ScriptReference/Rigidbody-isKinematic.html

 //Will the rigidbody feel gravity?
 rigidbody.useGravity = true/false;

https://docs.unity3d.com/ScriptReference/Rigidbody-useGravity.html

 //Will the rigidbody detect collisions?
 rigidbody.detectCollisions = true/false;

https://docs.unity3d.com/ScriptReference/Rigidbody-detectCollisions.html

Hope this will help you in the right direction!

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 move back and forth between scenes with the original scene changing? 1 Answer

Terrain gets blurry when i start the game 0 Answers

Enemy facing moving direction. 0 Answers

Find GameObject with value within script 2 Answers

How to make a 2d object back flip when a key is pressed 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