Set Animation bases on a variable?

Get help using Construct 2

Post » Mon Jun 26, 2017 9:56 am

Hello!

I have a problem and I couldn't find it anywhere (or I am too blind to find it).

For my game I have 2 skins for a character and his attacks have all a different looks based on the selected skin.

To reach this, I made an object for every skill and gave the skill the animation names "Default1" and "Default2" which is based on the selected skin, too.

When the attack is spawned, I want it to change to animation "Default" + the variable 1 or 2 based on which skin is selected. Is there a way to make it like that?
Because I can't put the variable name after the " " ends, neither can I connect them with a "+". When I put the whole expression into the " ", it will obviously think that I don't want the variable to be used.
B
13
S
2
Posts: 78
Reputation: 817

Post » Mon Jun 26, 2017 10:00 am

No way, I got it... didn't clicked on the right "help" link.
https://www.scirra.com/manual/78/expressions

It's :
set animation to: "Default" & selectedSkin

while selectedSkin is the variable.
B
13
S
2
Posts: 78
Reputation: 817


Return to How do I....?

Who is online

Users browsing this forum: ksiads, MathewHarrison, mtnboy22 and 1 guest