Game would not run in game maker and it said "cannot use function/script name for a variable,using"motion_add"

1k Views Asked by At

this was happening to me as I tried to make an astroids game on game maker. I put in the code motion_add[image_angle, 0.2] and it was working fine then it said

"cannot use function/script name for a variable,using"motion_add"

if you guys could help me I would be grateful thank you.

1

There are 1 best solutions below

6
An intern has no name On

You are using the motion_add() function. The syntax should be

motion_add(image_angle, 0.2);

when you use the " [ ] " symbols for the arguments, as you did, you are telling Game Maker to look for the data in the "motion_add" array at the coordinates "image_angle" and "0.2". That is not what you want. Also, do not forget the ";" at the end of your line.