Multiply Two Variables Correctly?

0 Favourites
• 5 posts
• I have two global number variables set in my event sheet.

and

BoostAmount = 2

So essentially I am doing 1100*2 and then 2200/2. But the number I get when I multiply the two variables is 17600, and then when it divides by 2 it goes back to 1100.

Also if I do just RoadSpeed*2 it comes out to 17600.

What am I doing wrong? Why does this not work correctly? If I use 1100*2 it works fine. What is happening to the math when it uses the variables instead of the numbers? <img src="smileys/smiley19.gif" border="0" align="middle" />

• Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• Ef me. Just figured it out.

I was setting the speed change to happen on overlap. Well it overlapped for 8 ticks, so *2 became *16.

Set it to on collision and it works.

I'll leave this here just in case someone has the same brain fart as I did.

• Don't you love it when you spend forever trying to solve something, so you make a post about it, and figure it out 3 minutes later? lol

I do this all the time. :D

• lol yeah, I am pretty good at that. It's like telling someone your problem and you figure it out as you're telling them about it. Sometimes your brain just has to think about it differently.

• so how did you do it??

how do you multiply a number by a var?