How do you load a particular asset in a j3o scene?

My question is concerning only the SDK with the terrain editor and scene composer :



If i have a j3o scene with a scenery ( foret , house terrain etc … ) and i put a character model . If i want to control that character with an input manager how do you load the asset inside the j3o and what are the step to get the character colliding with every elements of the scene ?



I think this will help a lot of people that are getting crazy like me :smiley: :smiley:



Please do a video that is showing the steps thank you :slight_smile:

[snippet id=“13”]

You are the man ! thanks a lot



So i guess you also assign a rigidbodycontrol to the character in the editor ?

Yeah you can, thats what I do in MonkeyZone. You can also create it programmatically.

I’ll try to do that thank you


normen said:
[snippet id="13"]


Maybe something i don't get here , if i load a Scene/Scene.j3o the model is already in so why would i need to load again the model ? What is "myGeometry" in the parameter of the getChild function exactly ?

myModel.j3o is your scene and myGeometry is your character. you could also just have separate objects for terrain and character like MonkeyZone.

Hello!



I think he just added the loadModel portion for completeness. If you’ve already done it, then super, you don’t need it again :stuck_out_tongue:



The “myGeometry” parameter is the name assigned to the mesh you’re looking for. In Blender, I think this is whatever you put into the ME: field for the object… I could be wrong. I fought with this a while back and still get those two fields confused with one another.



So if you’re looking for guyDudeMesh inside a scene, then you’d just put “guyDudeMesh” in there. Bear in mind, you’re searching on a string. So you might get null back if it can’t be found. Also, this opens the door to being able to search for substrings, which is how I’ve done a little scene parsing by prefixing meshes of interest. Like, for example, if you wanted all the doors in your scene, you’d prefix all of your door meshes with “door”, and if you wanted all of them, you’d loop through the scene looking for substrings containing “door.” It’s rather neat actually.



Cheers!

~FlaH

Thanks you two !