Page 1 of 1

Throw and retrieve actor

PostPosted: Sat Feb 11, 2006 7:31 am
by stevirt
Hey,

I am having some trouble with creating an actor only when one is not on screen. I shoot a ball and if it hits the correct object then it is destroyed - fine. If it hits the wrong object it just sticks to it - this is working and just what I want. My problem is that if the ball is stuck to an object or if it is flying through the air then I don't want to be able to create another one. So there is just one ball that you throw and go pick up again. Is there a way to create on actor only if that actor is not anywhere on screen?

Thanks for any help!!

PostPosted: Sat Feb 11, 2006 10:06 am
by Fuzzy
its essentially the same problem as being able to jump while already jumping. Set a variable that tells the actor when it is permissable to throw.

PostPosted: Sat Feb 11, 2006 5:40 pm
by stevirt
Ok. But what can I use to tell it that it is ok to throw? Can I say "if the actor exists, don't create another one."? Sorry, I'm new to this - having fun and spending too much time doing it, but still feeling my way around.

PostPosted: Sat Feb 11, 2006 5:49 pm
by stevirt
Nevermind! Threefinger Pete, you were more helpful than I thought. I just had to think about what you said for a minute. When the ball is thrown, the variable=1, when it is picked up again, the variable=0 - only allow the ball to be thrown when the variable=0 - Cool! Thanks!