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

SOLVED instance_create only flip one object

Q

Quree

Guest
My problem is that if you flip/mirror an object all created instances will flip with it.

I've tried this:
with (instance_create_depth(-40,-40,100,aRoad)){
aRoad.image_xscale = -1;}

Now if you do "aRoad.image_xscale = 1" it will flip, that's obvious, but is there a way to flip the road/object for that instance only?
 

FrostyCat

Redemption Seeker
You need to learn the difference between objects and instances.
NEVER set or use an instance's own variables with object.variable. An instance's own variables can be referenced as-is without dot prefixes. DO NOT use self. If multiple instances of the object exists, you might end up setting the value for all instances or for some other instance (depending on the export).
GML:
with (instance_create_depth(-40, -40, 100, aRoad)) {
    image_xscale = -1;
}
 
Top