Question by
AlvinFassari · Apr 25, 2018 at 10:48 PM ·
gameobjectlistdestroyrandomizeshaking
Shake GameObject in
Hello, so i have a script that tells my objects to fall. This is totally randomized. But before it falls i want it to shake so the player knows when its gonna fall. Piece of Script:
public void DestroyOBj()
{
index = Random.Range(0, objs.Count);
if (objs[index] != null)
objs[index].gameObject.GetComponent<Rigidbody>().useGravity = true; //Tells the object to fall.
oldNumber = index;
if(index == oldNumber)
{
objs.RemoveAt(index);
}
}
So as i said i want to make it so that the randomized gameobject makes a small shake before falling.
Please Help me with this. Thanks in advance! :) @AlvinFassari
Comment
Your answer
Follow this Question
Related Questions
How can I destroy a Gameobject from a list at a specific index 1 Answer
How to add a Gameobject to a list and remove it from Game World? 1 Answer
Destroy(GameObject) works after 3 attempts 0 Answers
No error code? Not sure where to go? 1 Answer
Another guy who doesnt get the Destroy function to work. 1 Answer