0
Answered

Instantiate Item From Object Location

CJWorkshop 4 months ago in Game Creator updated by Marti (Lead Developer) 4 months ago 1

Hey, 

I'm trying to make some sparks appear at an objects location, by using the instantiate action, but i can't work out how to do it. I saw in another post that you simply put the init location to the game object, but that isn't an option for me.

I tried using the local variable option, but when i do this, it doesn't spawn the sparks at that variables position in the world, it spawns them right in the middle of the editor. No matter where i place the variable, it always spawns them in the center of the world.


Any help would be greatly appreciated.


Thanks

Unity version:
Game Creator version:
Answered

If you try to get a position from a non-existing local variable or this local variable is null (in case of a game object type variable) it will return the default Vector3 value, which is (0,0,0).

Make sure the local variable you're using exists and has a value. Debug it using the Debug Variable action to print the value and see what's wrong.