Hey, how do i either delete the parent of an object from a script on the child OR send a true/false message to the parent?
plz JAVA :P
Hey, how do i either delete the parent of an object from a script on the child OR send a true/false message to the parent?
plz JAVA :P
Something like this:
var parent = transform.parent;
if (parent != null)
{
Destroy(parent.gameObject);
}
or this:
var parent = transform.parent;
if (parent != null)
{
parent.SendMessage("FunctionName", boolValue, SendMessageOptions.DontRequireReceiver);
}
// I think this is a bit more easier to send a message to parent
transform.root.gameObject.SendMessage (“AddPoint”, 1);