Welcome to the Game Creator support forum! 

This a place to ask questions, discuss ideas and report bugs. Please, provide your Unity and Game Creator versions as well as clear reproduction steps when opening a topic and full console logs.


Random amelioration

jpdevin 2 months ago in Game Creator updated by Marti (Lead Developer) 2 months ago 2

Your random function (say, grab a random value from a list variable) doesn't fit my needs, as it can pick the same value twice, so this is annoying for spawning prefabs (it may lead to a bug). Any clue to check if, let's say you spawn 10 prefabs, the 5th position has already assigned to a former prefab (sorry for my bad English) ? 

Under review

Determine whether NPC is near the Player in 2D

Oliver Marshall 2 months ago in Game Creator updated by Marti (Lead Developer) 2 months ago 7


Is there a way that I can tell whether an NPC is near a Player in a 2D environment?

I was hoping to use Perceptors, but I don't think they work in 2D (at least it doesn't work here). 

Is there another way?

I can see that there is a Distance condition in the Hub, but this doesn't appear to work with 2D either. 



how to implement a "while" condition

jpdevin 2 months ago in Game Creator updated by Marti (Lead Developer) 2 months ago 1


Everything is in the title, I would like a condition to loop until an event happens (ex : global variable = 0). I have tried to insert a "repeat action" under my if condition, but then it loops again and again and never gets out. 

Please help.

Marti (Lead Developer) 2 months ago

Hi JPDevin;

We get this question a lot, so it's good we can finally have a place we can relay to the answer. The thing is that we initially had a Trigger called "Update" that could constantly execute its associated Actions & Conditions, over and over again.

This works fine, but doesn't encourage good "coding" practices. This is what is commonly known as "Semaphore-Programming", where you test-check if a condition is true. If it is not, you check it the next frame until it's successful and execute it.

As you can imagine, this is not very performant. Instead, we want Game Creator to be event-based: Triggers listen (this is the keyword: listening) for certain events and react accordingly.

For example, to detect if a user presses a certain key, you could constantly check if the button is being pressed (bad) or simply add a listener to your input device and react only when it informs you back that the key was pressed.

Now going back to your questions, if you want to detect when a Global Variable is equal to zero, you can use the "On Variable Change" Trigger and call the Conditions there.

Hope this helps! :-)

Under review

suggestion for message actions

cel 2 months ago in Game Creator updated by Marti (Lead Developer) 2 months ago 1

would it be possible to add a field to the message actions (floating and standard) where we could select the prefab to use?

this way we could modify the original template and save it under a different name and use it on the action.

also a way not to use time in those actions and and have another action to hide the message


Shooting a Cannonball?

rholzem 2 months ago in Game Creator updated by Marti (Lead Developer) 2 months ago 3


how can I set the firing trigger for the cannon?

Marti (Lead Developer) 2 months ago


You are almost there! The Instantiate Action creates an instance of the "Cannon Ball" and you want to apply a force impulse to that, right?

First you need to have a reference to the instantiated "Cannon Ball". To do that, create a Local Variable below the Action of type "Game Object" and call it, for example "cannon-ball".

Then, under the Instantiate Action, where it says "Store (optional)", select Local Variable and drop in the "projectile" scene game object. Then, select the "cannon-ball" variable from the dropdown list.

Now you have a reference to the instantiated cannon ball. All that's left to do is apply force to this game object. To do it, using the Physics Action you have, change the "Target" field to "Local Variable". Repeat the same process as before: Drop in the "projectiles" game object and select the "cannon-ball" from the dropdown list.

That's is! Click play and click on the little "play button" at the bottom-right corner of the Action. This will allow you to debug this mechanic.

Hope this helps!


And how can I use the instantiate action to have…

jpdevin 2 months ago in Game Creator updated by Marti (Lead Developer) 2 months ago 3

And how can I use the instantiate action to have the prefab instantiated at a random place ?


Marti (Lead Developer) 2 months ago

I'm opening a separate topic for your question. Please, make sure from now on to post each question in a different topic. This helps keep things organized.

Regarding your question, you can use a List Variables pre-filled with random positions (use either Vector3 or Game Object types). Then, using the "Instantiate" action, set the position's source as a List Variable. You'll be able to choose "random" from the list of options available.



What kind of game is easy to do with game creator

Yeresoro Francois 2 months ago in Game Creator updated by Marti (Lead Developer) 2 months ago 3


I just bought game creator. I love the idea to have a tool with a lot of freedom to create different gameplay.

I would like to create games on mobile for kids.

Mostly puzzle, adventure or stealth

Gameplay being from monument valley style, to top down zelda, or adventure like very little nightmare, lara croft/hitman go...

I don't have that much knowledge of unity and game creator, and I would like to know which of those kind of gameplay would be the most easy to implement in gamecreator and the modules availables at the moment.

Also I wonder if you build a grid based logic in gamecreator ? If not I bought another asset "ultimate grids engine" for this purpose. Would it be easy to integrate it with gamecreator ?

Do you provide finger gesture, or are you compatible with touch gesture assets ?

Thank you

Marti (Lead Developer) 2 months ago

Hi Yeresoro;

Welcome to the Game Creator community :-) All the game types you mention are more or less feasible, depending on the complexity you want to add.

However, I'd recommend starting with a simple graphic adventure genre, since it's the most straight forward and easy to tackle type to start with. You won't even need other modules to get to something playable.

As a reference, in 2017 (so a long time ago, but it's still valid) we created a proof of concept demo using only the Game Creator tools. It was titled "The Investigation" and is a short game using only the core tools. You can check it out at: https://catsoftstudios.itch.io/the-investigation.

Creating something like this should be fairly easy and fun to get your hands on (of course, you can use more cartoonish characters and toon-shaders to make it more appealing to kids).

If you have any questions regarding how we did certain things, feel free to drop us a line or continue this conversation here.


PS: I did not answer about the grid system. Currently Game Creator only supports continuous environment. But if you really want to use cells, you can use the "Move Character To" action to make characters move to certain positions. There's no integration with the Ultimate Grids Engine, but if these can provide a Vector3 as the position, if you have a very basic knowledge of coding, you could easily make a Character move to a certain tile position. But this might be a bit advanced.


Execute Action Through Code.

Harley Torrisi 2 months ago in Game Creator updated by Marti (Lead Developer) 2 months ago 1


Not sure if this is a bug. But I was having issues with combining code and GameCreator.

Creating an RTS module for GameCreator. I have some classes with public Actions lists. The player can put actions there, on certain conditions defined by the RTS module. Those will be invoked.

I am using a combination of  Execute() and ExecuteWithTarget()

Each Actions item has its own bool value asking if the player wants to send the target. I'm not sure what target does, right now I'm only guessing its to do with the invoker.

So, handling a MoveCharacterTo action through GameCreator only works fine. But not with Executing through code.

I got up to switch (this.variable.GetVariableDataType(invoker)) of the GetTarget() function in ActionCharacterMoveTo.cs before it broke on me. Line 133.

GetVariableDataType() fails to process invoker. I don't know how I'm doing this wrong, it seemed like Execute() was a straight forward and easy function to call.

Anyways, In the meantime, I have amended ActionCharacterMoveTo.cs to get me through. But hopefully, someone can tell me if this needs a fix, or how I am meant to execute properly.

I added this to the above-mentioned switch temporarily. 

Marti (Lead Developer) 2 months ago

Hi Harley!

I forgot to update this topic, as we discussed it via Discord. This error should be fixed in Game Creator version 1.1.2, so I'm closing it. If there's any further issue, feel free to drop a line below and I'll reopen the ticket.


PS: Without getting into details, the problem was that the Invoker game object was being used as the direct target of the Actions, ignoring the settings of the Local Variable (which can be set to Invoker, Game Object, ...). This caused the Variable system to try to access a Local Variable from another object other than the desired target, hence returning a null value.

Under review

NullReferenceException when loading scene the second time from saved profile

MiTschMR 2 months ago in Game Creator updated by Marti (Lead Developer) 2 months ago 12

Hi Marti

In almost every game you have a main menu where you can configure different settings. The user starts the game, lands first in the Main Menu and then enters the game. He then thinks, "I could surely change <insert setting>", returns to the menu and changes the setting. After that he plays the game and finally exits it. When launching the game the next time, the settings should be the same as he left them. 

I'm trying to achieve the above use case with GC and the save load system. 

Process / Setup

  1. Check if profile exists
  2. Yes --> Load profile
  3. No --> Set profile number and save
  4. Apply settings according to global variables

The important part is the one where I load the profile. 

I have the following setup: 

Trigger OnStart


Notice the debug messages before and after loading the profile as well as after setting the profile number. 

And I have two scenes, Main_Menu and Forest_Environment_Test. 


When I first enter the Main Menu scene, I can set the settings and when I leave the game without entering the second scene, everything gets saved to the profile. However, when I enter the second scene (Forest_Environment_Test) and return to the first one (Main_Menu) I get a NullReferenceException. Here is the player.log file from loading Main_Menu the first time when everything works: 

Loading profile 1

//Some messages I don't know about
Setting up 4 worker threads for Enlighten.
  Thread -> id: 436c -> priority: 1 
  Thread -> id: af4 -> priority: 1 
  Thread -> id: 3098 -> priority: 1 
  Thread -> id: 3724 -> priority: 1 

Ending loading profile 1
Set current profile to 1

Saving profile 1

The line "Saving profile 1" is logged when I press one of the buttons on the left side: 

And here the player.log file from loading Main_Menu when returning from the second scene when it doesn't work anymore: 

Loading profile 1
NullReferenceException: Object reference not set to an instance of an object.
  at GameCreator.Characters.Character.ResetData () [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.SaveLoadManager+d__38.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.MonoBehaviour.StartCoroutine (System.Collections.IEnumerator routine) [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.SaveLoadManager.Load (System.Int32 profile, System.Action callback) [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.ActionLoadGame+d__3.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.IAction+d__3.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.IActionsList+ActionCoroutine+d__10.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.MonoBehaviour.StartCoroutine (System.Collections.IEnumerator routine) [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.IActionsList+ActionCoroutine..ctor (System.Collections.IEnumerator target) [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.IActionsList+d__7.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.MonoBehaviour.StartCoroutine (System.Collections.IEnumerator routine) [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.IActionsList.Execute (UnityEngine.GameObject target, System.Action callback, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.Actions.Execute (UnityEngine.GameObject target, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.Clause.ExecuteActions (UnityEngine.GameObject target, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.Conditions.Interact (UnityEngine.GameObject target, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.Trigger.Execute (UnityEngine.GameObject target, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.Igniter.ExecuteTrigger (UnityEngine.GameObject target, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.Igniter.ExecuteTrigger (UnityEngine.GameObject target) [0x00000] in <00000000000000000000000000000000>:0 
  at GameCreator.Core.IgniterStart.Start () [0x00000] in <00000000000000000000000000000000>:0 
GameCreator.Core.SaveLoadManager:Load(Int32, Action)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
GameCreator.Core.IActionsList:Execute(GameObject, Action, Object[])
GameCreator.Core.Actions:Execute(GameObject, Object[])
GameCreator.Core.Clause:ExecuteActions(GameObject, Object[])
GameCreator.Core.Conditions:Interact(GameObject, Object[])
GameCreator.Core.Trigger:Execute(GameObject, Object[])
GameCreator.Core.Igniter:ExecuteTrigger(GameObject, Object[])

Note how everything after the action "Load Game (profile 1)" does not get executed. Also, when I press one of the buttons to save the game, nothing gets executed. 

If you need more information, let me know. I'm at the end of my latin...




Multiple Mouse triggers in one place.

Kamil 2 months ago in Game Creator updated by Marti (Lead Developer) 2 months ago 2

Ok. I make a marker to maker what objects are interactive. It is on mouse enter show ring, and hide on mouse out. 

But under this mechanic I need to put trigger what actually does an interaction, so start actions when was clicked.  

But Marker trigger blocks the possibility of click on the interaction trigger. 

It looks like only one mouse oriented trigger can be in one place. 

Marti (Lead Developer) 2 months ago

Well. All the triggers should work on one collider. This worked fine.