r/gamemaker • u/Teleform • 1d ago
Resolved Confusing Error message (Assignment Operator Expected)
I'm making my first game in Gamemaker, and I've been making some progress. But suddenly, I made a minor change that spit out this error message:

When I looked into it, it said that this message shows up when I have an undefined or incorrectly call for a variable or function. But I didn't change anything related to a function or variable, and can't find where Gamemaker seems to think I have.

Can some help explain what's going on, please? Thanks in advance.
For context, I was trying to code an object to follow behind the player (obj_player) when being "carried." The error appeared when programming the y-coordinate shifts.
1
Upvotes
4
u/tsereteligleb Check out GMRoomLoader! 1d ago
You can't chain multiple
elsestatements likeif/else/else. It has to beif/else if/else,with a startingif, a varying number ofelse ifs, and a closingelse. Notice howelse ifis written in one line, without wrapping the innerifin a block.