Is there an event command that tell if “If an object has just been created” do this
there is one for the object spawner but I’m just doing a simple create object action. I have a on key pressed command that lets me create an object but as long as that object is on the screen no more of it can be created even if I pressed the key again
You could use the compare 2 numbers condition, and check if the number of objects in the scene = 0 before creating the object:
I see. Then how about the action that will prevent creation of additional objects?
There is no other action required… If there is an object in the scene, then the compare two number is false, and the event’s action are not performed.
Remember to replace the word “object” used as the ScreenInstancesCount parameter in my screen shot with the name of your object.
ah nice, it does work, thanks!
also I have another question but isn’t related to the topic
so whenever I interact with something in my game, I will pause everything then it will switch the scene to like a separate scene and I want to create an object from there, but the thing is I want to interact with different object in my first scene, then it will switch to the next scene and it will create an object specific to the object I interacted from the previous scene
like this: scene1 interact with object 1, switch scene and spawn an object specific to object 1 and so on
You could try this:
When (Object1) is interacted with,
Change {GlobalVariable1} to 1, and
Change scene
On the other scene:
If {GlobalVariable1} = 1,
Create Object2
Global variables can be found by pressing the 3 lines in the top-right corner
If the same object is used over multiple scenes, consider setting the object as a Global Object - right click on the scene object (or click on the 3 vertical dots) and select “Set as Global Object”. Additionally, create a global object group and to this add all the global objects.
Create a global array variable. Inth efirst scene, add each object’s name to this global array.
Then in the second scene, go through the array’s children, creating the object by name from the global group.
For example, I have a global object group named ‘MyGlobalObjectGroup’ and a global array variable named ‘ObjectToCarryOver’.
In the first scene, I add to the array:
And in the second scene (which has a scene variable ‘objectName’) I create the objects: