If object not on screen, create when a certain thing happens

For questions about using Classic.

Post » Wed Feb 03, 2010 7:27 pm

I have a targeting box that needs to be destroyed when an enemy is destroyed, but then needs to be created again when I lock onto another enemy. I can't get it to create the new target box ONLY if there isn't one already on the screen. I tried "Invert Condition" with "Is Object on Screen?" but it didn't work. Right now, it will create a new box every time I lock onto an enemy, with the old box(es) moving to the newly locked on enemy or even creating more on the same enemy.

Also, I want the box to be destroyed when the specific enemy it is following is destroyed, but if I use Object on Screen or Is Visible, it sees other enemies of the same type and won't destroy the box.
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Wed Feb 03, 2010 7:39 pm

when there's no object created there's no object to check against the is on screen condition.

If you're creating and destroying, you should be counting instances.
Try checking with targetbox.count<1
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests