ive been trying to find a way to do a quick and simple way to make a game object (enemy) shake when hit.
void Update()
{
if (Input.GetKeyDown(keyToPress))
{
if (canBePressed)
{
gameObject.SetActive(false);
Gone = true;
}
}
if (Gone)
{
}
}
im trying to attach the shake effect onto the if (gone) onto a script that the player has.