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

How to appear from one object to another

turtmip

Member
Hello, just wanted to know if theres a possible way to create an object right infront or beside a existing object. Like creating back the normal player object right beside the car object or whatever vechile.

Just want to know if theres a solution to this, and sorry if this does not make sense at all, ill try to explain it better in the comments if so.
 

Gamebot

Member
Assuming your sprite origins are both at zero, zero ( top, left) you should just be able to use instance_create_depth or instance_create_layer.

If your spawning right try using the sprite width for x and then "y" of the object that is spawning.
if your spawning down "x" for x then for y you would use sprite height.

If your sprites are different sizes ect...you would probably need to adjust yourself. You might have to figure out the difference in sizes and divide by two or something similar to that. Don't be afraid to play with your numbers a bit.

EDIT: If you are ALWAYS spawning a character ect by a car you could just adjust your origins.
A long way would also be to create four different sprites that only contain the mask_index ( collision box ) where the origins are set just to the left, right, top and bottom of the actual sprite.
 
Top