M
mrwappa
Guest
NOTE: I am new to the Game Maker language and don't have any noteable experience with sharing variables from different objects and instances!
I have the following problem:
at gml_Object_o_circlegun_StepNormalEvent_1 (line 18) - if instance_exists(Bullet.TouchPlayer)
I am trying to:
I have the following problem:
- I have been unsuccesfully trying to access a variable that checks collision from a different object
- Error I'm receiving:
at gml_Object_o_circlegun_StepNormalEvent_1 (line 18) - if instance_exists(Bullet.TouchPlayer)
I am trying to:
- I'm trying to access a variable that checks collision from a different object than the variable is declared
- Code(Step Event) of object that checks collision(o_bulleth):
PlayerTouch = instance_place(x,y,o_player)
PlayerTouch.Bullet = self.id
Code(Step Event) of object that uses the variable PlayerTouch from o_bulleth(o_circlegun):
if instance_exists(Bullet.TouchPlayer)
{ image_angle -= 2.5 } else { image_angle += 2.5
}
- The goal of this is to make o_circlegun rotate either clockwise or counterclockwise depending on if o_bulleth has had a collision(touched) with o_player
- I've searched for different methods, for example: How to grab X and Y of an instance(So I could use instance_place in the o_circlegun object), or adressing variables from other instances by making the global.
- I tried to solve the problem by using this guide.
- GameMaker version: Professional Edition(v1.4.1757)
- Tutorials/resources used:
http://stackoverflow.com/questions/...-instance-variable-from-other-instance-object
http://gamemaker.info/en/manual/401_06_addressing
- GameMaker Language (GML)