Text not setting to instance variables?

Just started using Construct 2? Post your questions here

Post » Wed Nov 09, 2016 11:58 am

Hi

I am having difficulties switching an objects instance variable from 1 to 2 and back again (I think I should be using the boolean thing but I would have thought this would have worked too)

I basically want an enemy to switch to another mode when his health reaches 120 (from 180)
My idea was while mode/variable=1; bullet subtracts 4 from health/variable on collision
when health reaches 120, mode variable switches to 2 (bullet doesnt subtract from health variable when in this mode)

This works, but then I had it wait for 4 seconds before it set value back to mode/variable 1 but it won't switch back untill the enemy is hit with bullet?

https://www.dropbox.com/s/n37p4kla0b0sxnz/code.png?dl=0

Very confused about this? tried many variations with very random results

thanks
B
3
Posts: 2
Reputation: 179

Post » Wed Nov 09, 2016 3:16 pm

Try to add a condition "Trigger once while true" to the "health=120" condition.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Wed Nov 09, 2016 8:33 pm

Wow, awesome that works, thanks heaps
B
3
Posts: 2
Reputation: 179


Return to Beginner's Questions

Who is online

Users browsing this forum: kainrazial and 4 guests