you need to parent it to the plane, or copy to location/rotation of the plane.
those missles are static? or do you spawn them?
Because i would parent an empty to the plane, parent missles to the empty, move em to layer 2 and spawn in the empty.
so you spawn everything and due to the empty is parented to the plane it will stick.
F15 (group)
- Component: Variant Single/Double seater, side fuel tank, gears, etc.
Missiles
- AIM9(group), AIM7(group), etc
Explosions
Other Assests
Theater_Iraq
Theater_Kuwait
Theater_Afghanistan
Currently, the background smokes (from other scene) are manually placed.
The fuel tank (object) is parented to the empty under the belly.
The missile (grouped: fins, sensors, etc) are manually place and parented to the plane in F-15 scene.
Spawning missile from another scene or the same scene (different layer) as in F-15 only shown in the F-15 scene.
F-15 (group) are placed manually at the theater (in the video/game scene)
for in game you can use empties and parent them to the place where the missiles should be and than you can with python or game actuators parent the missiles to the empties. (so if you want that they fall down if they don’t parented anymore)
did you try to make something with duplication group and bound the main object to the plane or else?
don’t know if this work
did you try to make something with duplication group and bound the main object to the plane or else?
don’t know if this work
look at the blend, he uses 3 scenes, 1 group a scene, and he shows them all in scene one.
the error is due to the parenting, because you parent an object to an object that is in an other scene.
addedInstance = own.scene.addObject('instanceCopyNameOnHiddenLayer')
for objects in addedInstance.groupMembers:
if 'PropertyTag' in objects:
do.stuff()
The reason is simple, you need to know the internal structure of the group.
This may sound like it is no issue.
Imagine you change the group. Do to this dependency the above code might not work correctly anymore. This issue might be less obvious and more dangerous, when the group resides within another file. The group and the users are explicitly separated. When you maintain your asset files you will surely not see this kind of dependency -> high risk on introducing errors.
I suggest to design your assets in following way:
A) only the group knows about the structure of the group (no body outside the group)
B) define an interface how to interact with the group without publishing internals
For example you want to create a flag with pole and softbody plane. The softbody gets constraints to the the pole. The whole flag (group) is supposed to follow wherever the pole gets parented to.
How to do that:
Search the pole, and parent it to the target
Who searches?
What is the target?
Searching the pole from outside needs to publish internals (how to find a pole). But the outside knows the target. But it is still no good design. Image you later want a base where the pole is parented to. That means you need the change all users of the group.
Let the group do that:
No need to search, the group already knows the pole (or whatever the base is).
The group does not know the target … you need an interface to tell the instance what the target is.
This example is pretty simple: you can use the instance object as target. Blender allows you to parent the instance object to the real target (e.g. a car).
Solution:
interface: parent is the instance object
implementation: one object of the group parents the pole to the instance object
upgrade: the base will be parented to the instance object. As the interface does not change the users do not need to change.
Be aware:
a group has no instance object. You need to test this behavior on an instance rather than the group (= instantiate the group in your test scene.)
changes to the interface require a change to the group and the instance users.
instances can be part of another group
Examples of other interfaces:
Properties:
use the properties of the instance object for input/output of properties
Other objects:
you can parent other objects to the instance object. You can differentiate them by properties.
example: you have a vehicle as car, you want to parent something the body of the car (e.g. a flag).
you can use actuators that refer to specific objects at the instance object
example: Use the camera actuator to refer to the camera, the instance can read the reference from the actuator (without activating it). It is a bit thinking-around-the-corner, but you do not need to establish a parent-child relationship.
you define criteria on how to identify objects within the current scene.
Example: A car should steer on a navigation mesh. This solution requires the criteria uniquely identify objects. E.g. two navigation meshes would cause trouble.
The reason is simple, you need to know the internal structure of the group.
This may sound like it is no issue. But it is.
Imagine you change the group. Due to this dependency the above code might not work correctly anymore. This issue can be less obvious and is more dangerous when the group resides within another file. The group and the users are explicitly separated. When you maintain your asset files you will surely not see this kind of dependency -> high risk on introducing errors.
I suggest to design your assets in following way:
A) only the group knows about the structure of the group (no body outside the group)
B) define an interface how to interact with the group without publishing internals
For example you want to create a flag with pole and softbody plane. The softbody gets constraints to the the pole. The whole flag (group) is supposed to follow wherever the pole gets parented to.
How to do that:
Search the pole, and parent it to the target
Who searches?
What is the target?
Searching the pole from outside needs to publish internals (how to find a pole). But the outside knows the target. But it is still no good design. Image you later want a base where the pole is parented to. That means you need the change all users of the group.
Let the group do that:
No need to search, the group already knows the pole (or whatever the base is).
The group does not know the target … you need an interface to tell the instance what the target is.
This example is pretty simple: you can use the instance object as target. Blender allows you to parent the instance object to the real target (e.g. a car).
Solution:
interface: parent is the instance object
implementation: one object of the group parents the pole to the instance object
upgrade: the base will be parented to the instance object. As the interface does not change the users do not need to change.
Be aware:
a group has no instance object. You need to test this behavior on an instance rather than the group (= instantiate the group in your test scene.)
changes to the interface require a change to the group and the instance users.
instances can be part of another group
Examples of other interfaces:
Properties:
use the properties of the instance object for input/output of properties
Other objects:
you can parent other objects to the instance object. You can differentiate them by properties.
example: you have a vehicle as car, you want to parent something the body of the car (e.g. a flag).
you can use actuators that refer to specific objects at the instance object
example: Use the camera actuator to refer to the camera, the instance can read the reference from the actuator (without activating it). It is a bit thinking-around-the-corner, but you do not need to establish a parent-child relationship.
you define criteria on how to identify objects within the current scene.
Example: A car should steer on a navigation mesh. This solution requires the criteria uniquely identify objects. E.g. two navigation meshes would cause trouble.
Group instances (and python components) are my bread and butter. It sucks that you can’t parent groups in the editor.
I use a Monster-flavored version of what BPR does.
if owner.groupObject is not None:
# This object is part of a group
parent = owner.groupObject.parent
if parent is not None:
# Use the same parent
owner.setParent(parent)