• 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.

Question - Code help with "while"

not_the_fbi

Member
hi! i'm new to gamemaker and i might just have been an idiot here but in line 5 position 6 it says there is and unexpected symbol please help!

if (place_meeting(x+hspd, y, obj_wall)) (
while (place_meeting(x+sign(hspd), y, obj_wall)) (
x+=sign(hspd);
)
hspd = 0;
)

x+=hspd;
 

chamaeleon

Member
Parenthesis is not the same as braces. If you have not studied the GML overview section in the manual yet, I strongly recommend you do so. Also, I strongly recommend getting acquainted with the event model implemented by GMS, the difference between Objects and Instances, and the categories of functions in the GML reference (categories to begin with, not learning all of the functions within them at once, in order to understand what kinds of tools you may have at your disposal, and as you dive deeper, explore a category at a time to solve specific problems).
 
Top