• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows not understanding a camera error when creating an object?

L

LilBrudda

Guest
Here's my code:

GML:
 temp_card = instance_create_layer(x + (instance_count(blank_resource_card) * 400), y , "Instances", Military_Resource);
but when running it gives me this error:
############################################################################################
ERROR in
action number 1
of Mouse Event for Left Pressed
for object Resource_control:

camera_set_view_speed() - wrong number of arguments
at gml_Object_Resource_control_Mouse_4 (line 113) - temp_card = instance_create_layer(x + (instance_count(blank_resource_card) * 400), y , "Instances", Diplomacy_Resource);
############################################################################################
gml_Object_Resource_control_Mouse_4 (line 113)

not sure how camera is involved at all?
Thank you.
 

TsukaYuriko

☄️
Forum Staff
Moderator
instance_count is not a function. It's a variable.

The value it contains at this point in time happens to be the internal ID of the camera_set_view_speed function.

After this value, your code contains parentheses and arguments... so you're calling the function with that ID with a certain amount of arguments that it doesn't support. ;)


Did you intend to use instance_number?
 
Top