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.
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:
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;
//Will the rigidbody feel gravity?
rigidbody.useGravity = true/false;
//Will the rigidbody detect collisions?
rigidbody.detectCollisions = true/false;
Hope this will help you in the right direction!