How do I Fix this Function Expression

Get help using Construct 2

Post » Mon Sep 05, 2016 9:07 am

Can anyone tell me why I keep getting a return value of 0?
My players weapon damages are 30 and 50. The monster's DEF is only at 10. I should not be getting zero.
Image

Thank You,
Stephen
B
56
S
15
G
13
Posts: 826
Reputation: 17,645

Post » Mon Sep 05, 2016 10:32 am

Your function does nothing. '=' means compare equality, not assign, so your "call expression" action calculates a true/false result based on a long comparison - which does not alter any values - and then throws away the result and returns an unchanged variable.
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,684

Post » Mon Sep 05, 2016 8:18 pm

Figured it out, thanks Ashley!

Image
Image
B
56
S
15
G
13
Posts: 826
Reputation: 17,645


Return to How do I....?

Who is online

Users browsing this forum: Shenkai the ssj, tarek2 and 25 guests