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

Problem With Slope Collision Heights Array

S

Skig

Guest
I have been watching Shawn Spalding's video on slope collisions. There is a certain global variable that determines the height of the slope called Global.heights. To get an overview of the project and where the variable is, the link to the video is right here:
. There is an error showing that the variable is not an array when touching the slope.
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object o_player:

trying to index a variable which is not an array
at gml_Script_in_floor (line 7) - var thefloor = global.heights[argument1 mod SLOPE_TILE_SIZE + pos * SLOPE_TILE_SIZE];
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_in_floor (line 7)
called from - gml_Object_o_player_Step_0 (line 78) - var floordist = in_floor(global.map, x, bbox_bottom + vsp);

Also, my project is a bit modified from Shawn's. Please feel free to tell me anything you didn't understand.
 
Top