check if actor has a parent?

Non-platform specific questions.

check if actor has a parent?

Postby Fojam » Sun Aug 26, 2012 4:13 pm

is there a way to check if an actor has a parent?
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: check if actor has a parent?

Postby skydereign » Sun Aug 26, 2012 10:47 pm

Invalid actors in gE have a name equal to "" and cloneindex of -1. Every actor can use the parent reference, even if the parent actor doesn't exist (invalid).
Code: Select all
if(parent.cloneindex!=-1) // has a parent
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest