Importing/spawning objects in scene

Hello everyone,

I just started using the blender engine and I was wondering how to import object X into a scene at runtime. For example, say a player hits a block I want to spawn a coin object I have in another .blend file. Pretty much I’m looking for what is the best way to setup all of my assets for my game. Do I need to place all my assets in the scene before hand (out of sight W3 style), or can I load them in from their respective files at runtime? If what I am asking isn’t clear enough yet, what I’m trying to do is sorta setup prefabs (like what is in unity) to spawn objects into my scene from.

Also, does anybody have any guides for creating armor for player models. I know the basics of it, but I’m looking for the best method to implement it. 1. Model armor piece around player model, 2. Either hide armor piece an unhide when equipped, or have it load it from a file or asset location. :eek:

Thanks in advance.

So the best way to do it this is to place your assets in a seperate layer and simply change their layer? Wouldn’t that mean you’d have to copy over all of the assets from scene 1 to scene 2?? Can scene 2 access objects in scene 1 layer 2, or would they need to be copied over?

Think of the layers as storage- layer 1 is for the game, layer 2 etc is for objects used in game.

Objects in Scene 1 layer 1 spawn objects from Scene 1 layer 2, so in my example I posted the monkey head is kept in layer 2 as well as the helmet and breastplate for the knight. The knight itself stays in layer 1 as this layer is where the game takes place.

As far as I know (with my basic Python skills) there is no way to spawn from one scene to another, so you would have to duplicate objects as you thought (which is annoying). However, you can send messages between scenes using Python (for things like variables, scores etc).

Well that doesn’t seem like it’ll be too much of a problem. I don’t plan on changing scenes often. Thanks for the info.