Quantcast
Channel: Active questions tagged game-maker - Stack Overflow
Viewing all articles
Browse latest Browse all 189

How do i fix "unassigned variable instance_create referenced" in Gamermaker newest version

$
0
0

So I am getting an error message that says "unassigned variable instance_create referenced"I am not sure why I get it but I have tried to fix it but with no luck, does anyone know what can cause this?

Here is my code, it is meant to be a point and click movement system.

// Initialize destination coordinates if they don't existif (is_undefined(_destinationX) || is_undefined(_destinationY)) {_destinationX = instance_create(0, 0, obj_null);show_message("Instance created for _destinationX");_destinationY = instance_create(0, 0, obj_null);show_message("Instance created for _destinationY");}// Set the coordinates for _destinationX and _destinationY objectsif ((!_destinationX.x && _destinationX.x != 0) || (!_destinationY.y && _destinationY.y != 0)) {    _destinationX.x = x + 64; // set x coordinate    _destinationX.y = y; // set y coordinate    _destinationY.x = x; // set x coordinate    _destinationY.y = y + 64; // set y coordinate}// Move towards the destinationmove_towards_point(_destinationX.x, _destinationY.y, _speed);

I have tried a bunch of different things, I searched a bit and got the answer that i was missing an extention but i could never find it and i think it is for an older version of gamemaker.


Viewing all articles
Browse latest Browse all 189

Trending Articles