New answers tagged scripting
If it's 2D then you can simply use: rigidbody2D.gravityScale = -1;. You tagged the question 2D so this should be all you need to do. To toggle isntead of simply set you can change it to rigidbody2D.gravityScale *= -1; If it's 3D and you want the entire scene to have gravity reversed you can do: Physics.gravity = new Vector3(0, -1.0F, 0); If it's 3D and you ...
You should try to disable the rigidbody's useGravity property when the collision happens and use AddForce to fake your upwards gravity, pretty much like the example in AddForce documentation.
As Savlon suggested in comments, create the red objects first. You probably want to split your array into red prefabs and non-red prefabs. Your CreateGrid function will look like the following pseudocode: Repeat four times: place a random red object at a random point on the grid. Repeat for each grid square: if the grid square is empty (does not contain a ...
Top 50 recent answers are included