What's the best way for an instance/object to reference the instance that created it and then store that as a variable, but without doing it via checking for a collision or which one is nearest?
I have an enemy instance which creates an instance of a hit object and I want it to follow the enemy...
Hello everyone! I have checked all the instances related to this particular one but I couldn't find anything. It works fine (it's has important configuration variables like "Which character you picked" or "Which event you're playing", etc..) but when it goes to a special room, all it's variables...
I'm trying to iterate through layers and then all the elements in each layer and print out the names. I figured out how to do this for sprites but not for instances
The short version is I call object_get_name but I'm guessing I need to do something else.
var __inst =...
I've created this simple code and depending what kind of object is selected I want to perform different actions on it, but looks like I always get default case. I don’t know where I messed up? Thank You for pointing my mistake :)
if mouse_check_button_pressed(mb_left) {
instance =...
Hi everyone! Id like to create an object via the Create_Instance, but only one.
Because using the Step Event, the object created is more than one.
There is a way I could create just one?
Thanks again! :D
Ok is very simple, I have an object with this in create event:
acc_y = -8;
and this in the step event:
if (acc_y < 12) { acc_y +0,25}
y = y + acc_y;
Now i thought that the istances of the object didn't share the internal variables. When I spawn one moster his speed will be like +5, but if i...
I was wondering how I can delete certain instances of an object.
I created a wall object, and I wanted it to be deleted whenever my character opens up the menu, (scr_menu), and selects delete (or case 0 from that script).
I was wondering if it was possible to do this after placing the tiles in...
So the player object is supposed to cross over a floor object, with the floor object switching to a red floor object. If the player object is not touching the red floor object anymore, the red floor object dissapears and turns into a wall object, meaning they can't go back.the
Here's the code...
I received the following error
I'm working on an "aim/view" system that extends the view of the camera in relation to where the player is facing and if the player presses the aim key (aim_key = gamepad_button_check(0, gp_shoulderlb)) (if the player is facing left, the camera moves vertically...
hello.
So i have my guy standing with his standing animation. then when i press 'T' i want him to attack using the following:
instance_change(obj_player_hit, false);
But when the instance changes, the animation doesn't start from the first frame. It starts from the frame of the previous...
Hi, there's a GMS2 bug which I am dealing with here. https://bugs.yoyogames.com/view.php?id=27963. Here is the thread where this originated from. It's a year old so you can imagine I'm a bit peeved that it still hasn't been fixed either...
In my game it has several obj_enemy instances. There is another object called obj_vision that is supposed to follow the enemy around. There is one obj_vision per obj_enemy. I cannot do jump to obj_enemy.x/y per step because that would cause all the obj_visions to go to 1 obj_enemy. So I gave all...
Hey! I already submited a bug report for this, but I haven't got a response in a while (I think?) so I'm trying my luck here.
After updating to the last GMS2 version this message started appearing while compiling, which says: "Reference to object isn't stablished as an instance of an object"...
Hello,
Seems that the function layer_instance_get_instance is not defined neither for the HTML5 export, Test and Debug.
I've created a simple example with nothing except a call of this function and I get the same error. How come this function does not exist in HTML5? Should I file a bug...
I have a program when an obj_pawn move (when key released) on one square towards wall and when obj_pawn is next to wall it will destroy and then when i released a key the obj_pawn respawns again and do the same thing again.
So, I have an object of obj_pawn and it works great. But when i create...
So someone asked a question on reddit about instances following the individual object that creates them.
If you look at the posted solution, it works perfectly but I don't understand why. Here's what they wrote:
Haven't been programming for long so I don't understand the "inst.creator"...
Hello!
I would like to remove the Step Event for some objects during run time (i.e, while playing the game) via code, is it possible?
For example, let's say I have an object with Step Event defined in IDE. Then I run the game, start playing, an instance of that object is created, and later I...
I have a problem with creating intances of an object.
I need to move instance to the wall (after key released) then this instance should destroy. After destroing when i realesed a key (again) it shoul be placed into its first position and then repeat this action again. The problem is in not...
I have created a bunch of instances, I want to know how I would know if I clicked it because position_meeting() would activate all of them. It's a pretty simple problem but I haven't been able to find any answer anywhere.
Hey! This is my first post on the forum so I'll try to be as clear as possible!
I'm creating a digital version of the board game "battleship" for a coding class at my high school; however, I've run into some issues trying to get my grid to detect when an object is within a specific square. I...