0
$\begingroup$

I'm new to Blender and try to make my first simple game using BGE. In order to win this hypothetical game, a character has to collide with multiple spheres. During the collision, spheres should disappear and increment some global score, thus the logic for all of them will be the same. I noticed that when I duplicate a sphere (using Shift+D) and then change the color of the original one, the color of the other one changes as well. Sadly, it doesn't work that way in case of "logic bricks".

$\endgroup$
1
$\begingroup$

The logic bricks are never shared.

The BGE is not designed to do that (unfortunately).

In your situation it is not a big deal.

Equal objects

You can get equal objects (inclusive the same logic), by creating a group (with the sphere). Place the group object in another layer, scene or blend file.

Then create instances of the group within your level scene. Instances share everything of the group object. This includes logic.

Dynamically created

Place an instance at a hidden layer. Dynamically add copies of that instance via Edit Object Actuator (Add mode) or via Python.

This will even work in conjunction with already placed instances.

Dynamically created copies.

Place the sphere with logic at a hidden layer. Dynamically add copies of that object via Edit Object Actuator (Add mode) or via Python.

| improve this answer | |
$\endgroup$
  • $\begingroup$ But can I create the objects statically in the editor? I only want to make 10 of them, in specific positions. $\endgroup$ – Luke Nov 7 '17 at 12:32
  • 1
    $\begingroup$ Yes, you can create instances via <shift+a>\Group Instance\... while you are within the 3d Editor. $\endgroup$ – Monster Nov 9 '17 at 12:33
0
$\begingroup$

Additionally to Monster's answer I found the followig video tutorial helpful: https://www.youtube.com/watch?v=qjFEcgB8zUg.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.