Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

Livecoding for GameMaker: Studio / GameMaker Studio 2 · By YellowAfterlife

Problem with move_and_collide

A topic by Christopher Schwarz created Jan 20, 2024 Views: 103 Replies: 2
Viewing posts 1 to 3

When I update a step event containing move_and_collide like this:


collider = [tilemap, obj_enemy_parent]; //all elements to collide with

move_and_collide(move_x, move_y, collider, 4, 0, 0, move_speed, -1);


it throws an error: Error:: move_and_collide::current self is not an instance

I'm not sure in which argument of the function the current self is referenced.

Plus when you don't use the 5 optional arguments in that function it throws an error saying the functions needs 8 arguments, even though they are optional.

Developer

You’ll want to use live_function_add to override the signature for move_and_collide, perhaps like so (in the end of obj_gmlive Create):

live_function_add(":move_and_collide(...)", move_and_collide)

That worked, thank you.