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,675

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
399
S
236
G
89
Posts: 24,519
Reputation: 195,361

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,675


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 47 guests