<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://graalonline.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Julienm20</id>
	<title>Graal Bible - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://graalonline.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Julienm20"/>
	<link rel="alternate" type="text/html" href="https://graalonline.net/Special:Contributions/Julienm20"/>
	<updated>2026-04-09T20:46:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.4</generator>
	<entry>
		<id>https://graalonline.net/index.php?title=Graal3D_Scripting_Manual&amp;diff=20969</id>
		<title>Graal3D Scripting Manual</title>
		<link rel="alternate" type="text/html" href="https://graalonline.net/index.php?title=Graal3D_Scripting_Manual&amp;diff=20969"/>
		<updated>2021-12-01T16:33:01Z</updated>

		<summary type="html">&lt;p&gt;Julienm20: Added a section to link to the form to get access to testbed3d server to start development.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intro ==&lt;br /&gt;
[[File:Graal kart start.jpg|center|frame]]&lt;br /&gt;
Welcome to the Graal3D Scripting Manual!&lt;br /&gt;
&lt;br /&gt;
This Manual comes in handy for beginners wanting to learn Graal3D Scripting, and advanced developers looking to expand their knowledge, as it  contains documentation, examples, tutorials and much more...&lt;br /&gt;
&lt;br /&gt;
What we will focus on in this Manual is programming our gameplay (scripting the behavior of our GameObjects, their interactions, the components attached to them...)&lt;br /&gt;
&lt;br /&gt;
==== How things work in Unity: ====&lt;br /&gt;
Unity is the leading platform for building 2D, 3D, VR and augmented reality games. It offers a scripting API in C#, allowing us to interact with the unity editor and the games we want to build.&lt;br /&gt;
&lt;br /&gt;
In the Unity editor, we create and add GameObjects to our scene, we then attach C# scripts to each that will all run upon starting the scene. Unity sort of runs everything for you, it reads through all the lights, cameras, meshes, behaviors… and processes it for you.&lt;br /&gt;
&lt;br /&gt;
==== How things work in Graal3D: ====&lt;br /&gt;
Since we will be using the Graal Unity Binding, things will be a bit different.&lt;br /&gt;
&lt;br /&gt;
The Graal Unity Binding is a binding between GraalScript and Unity, it is actually still in alpha, but most functionalities needed are present. The goal of this binding is to mimic the Unity C# scripting system (functions and classes). So if you are familiar with Unity and C#, everything should be easy. If not, then do not worry, I will go over everything step by step and include examples done in C# and compare them to GraalScript for each topic.&lt;br /&gt;
&lt;br /&gt;
The Worlds Client (which you will have to download) will serve as the Unity base scene where you instantiate your GameObjects and manipulate them with your GraalScripts.&lt;br /&gt;
&lt;br /&gt;
==== Required Downloads: ====&lt;br /&gt;
'''Unity 2020.2.2f1:''' &amp;lt;nowiki&amp;gt;https://unity3d.com/get-unity/download/archive&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''The Worlds Client:''' &amp;lt;nowiki&amp;gt;https://www.graalonline.com/playerworlds/downloads/file?name=WorldsSetup64-518.exe&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''RC:''' More here ([[Creation/Management/Remote Control|RC]]) or download directly here http://fp4.ca/windows_rc3_beta.zip&lt;br /&gt;
&lt;br /&gt;
==== Get Started With Testbed3D Development: ====&lt;br /&gt;
After downloading Unity, the worlds client, and RC3, you can now submit through the google form below to be given access to testbed3D and start your GS2 and Graal3D scripting journey.&lt;br /&gt;
&lt;br /&gt;
[http://fp4.ca/windows_rc3_beta.zip https://forms.gle/4oYnmKzQ85MVDyB99]&lt;br /&gt;
[[File:RC3 testbed3D.png|center|frameless|388x388px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you login in RC3 and see &amp;quot;Testbed3d&amp;quot; in your server list congratulations you have been accepted and can now start development on the Testbed3D server.&lt;br /&gt;
&lt;br /&gt;
==== Tools ====&lt;br /&gt;
In-game Unity Tools (''mimic the Unity Editor)'' &amp;amp; Game Functionality Tools ''(warping, fixing graphics, starting minigames...):'' &amp;lt;u&amp;gt;[[Tools]]&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
==== Unity ====&lt;br /&gt;
&lt;br /&gt;
* [[Overview On Unity Basics]]&lt;br /&gt;
&lt;br /&gt;
==== AssetBundles ====&lt;br /&gt;
&lt;br /&gt;
* [[Uploading and Loading AssetBundles]]&lt;br /&gt;
*[[Placing GameObjects in NPC]]&lt;br /&gt;
&lt;br /&gt;
==== Examples and Tutorials ====&lt;br /&gt;
*[[Getting Started Examples]]&lt;br /&gt;
*[[3DTutorials|Tutorials]]&lt;br /&gt;
*[[Unity UI]]&lt;br /&gt;
&lt;br /&gt;
==== Classes, Functions and Variables ====&lt;br /&gt;
&lt;br /&gt;
* [https://quattro3d.graalonline.com/Documentation/ Quattro3D Scripting]&lt;/div&gt;</summary>
		<author><name>Julienm20</name></author>
	</entry>
	<entry>
		<id>https://graalonline.net/index.php?title=File:RC3_testbed3D.png&amp;diff=20968</id>
		<title>File:RC3 testbed3D.png</title>
		<link rel="alternate" type="text/html" href="https://graalonline.net/index.php?title=File:RC3_testbed3D.png&amp;diff=20968"/>
		<updated>2021-12-01T15:50:24Z</updated>

		<summary type="html">&lt;p&gt;Julienm20: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The server that you will see when logging in to RC3 when allowed to enter testbed development&lt;/div&gt;</summary>
		<author><name>Julienm20</name></author>
	</entry>
	<entry>
		<id>https://graalonline.net/index.php?title=Unity_UI&amp;diff=20955</id>
		<title>Unity UI</title>
		<link rel="alternate" type="text/html" href="https://graalonline.net/index.php?title=Unity_UI&amp;diff=20955"/>
		<updated>2021-11-16T15:42:01Z</updated>

		<summary type="html">&lt;p&gt;Julienm20: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:UnityUI.png|thumb|889x889px|none]]In this section we will go over an example of making a UI on unity and uploading and coding it on Client3D in graalscript.&lt;br /&gt;
&lt;br /&gt;
'''Unity Part:'''&lt;br /&gt;
&lt;br /&gt;
Open the “Quattro3D- Unity Project for bundle asset creation” folder using unity hub.&lt;br /&gt;
&lt;br /&gt;
To the assets folder, add we add a folder that will hold all the prefabs of the assetbundle.&lt;br /&gt;
&lt;br /&gt;
To the scene, add a Canvas (in the Hierarchy, right click -&amp;gt; UI -&amp;gt; Canvas). The Canvas will hold all the elements of our UI (buttons, text, scrollbar, images…).&lt;br /&gt;
&lt;br /&gt;
Select the Canvas and in the Inspector go to '''Canvas Scaler''' and select '''Scale With Screen''' for '''UI Scale Mode'''. This will allow the canvas Canvas to expand to full screen on all screens.&lt;br /&gt;
&lt;br /&gt;
Now to build the UI you see above (devtools). Start by adding Text elements (right click on Canvas -&amp;gt; UI -&amp;gt; Text).&lt;br /&gt;
&lt;br /&gt;
For each element, change the name and the text according to its function, change the color to white, add a button component and add a animation component. In the '''Rect Transform''' component, in the Anchor Presets, hold Alt and select top left to position your element.&lt;br /&gt;
&lt;br /&gt;
Add all the Text elements and position them (Inspector, Bundle Explorer, Console, Camera, Rendering).&lt;br /&gt;
&lt;br /&gt;
Now, to add the back button. Add an Image element to the UI, change its name to “back”, and in the image component add the source of the image (drop down in our case). Rotate it -90 deg on the Z axis for it to face left. Add a button component to turn it to a back button that closes the devtools.&lt;br /&gt;
&lt;br /&gt;
For the grey background you see, add and image just like before, change its color to black and change the A field in RGBA to 48 to make it transparent. Add an '''Outline''' component and change the '''Effect Color''' to white to add an outline to the image.&lt;br /&gt;
[[File:Unity UI.png|none|thumb|1006x1006px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now that we’ve added all our elements to the Canvas, it’s time to create our animations.&lt;br /&gt;
&lt;br /&gt;
To create an animation, in the top menu (next to Files, Edit, Assets…) go to Window -&amp;gt; Animation -&amp;gt; Animation.&lt;br /&gt;
&lt;br /&gt;
The animation tab should open in the bottom. Select the component you want to create an animation for and create and name the animation.&lt;br /&gt;
&lt;br /&gt;
We will be doing the sliding background image example for the animation. &lt;br /&gt;
&lt;br /&gt;
To record the animation, press on the record button. We want the image to slide in. So put the cursor on time 0s, and change the Pos X to -65 (outside of the screen) then move the cursor to 4s and change the Pos X back to 65. Press the record button again to save the recording. &lt;br /&gt;
[[File:Unity UI anim.png|none|thumb|1032x1032px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can press play to view your animation in action. To add the animation to the element; simply add an animation component and add the source of the animation you just created.&lt;br /&gt;
&lt;br /&gt;
Same thing goes for all the other animations.&lt;br /&gt;
&lt;br /&gt;
'''Graal Script Part:'''&lt;br /&gt;
&lt;br /&gt;
Now that we’ve created our prefabs and added the animations, our canvas is ready to be uploaded on the server and scripted. Save the AssetBundle and upload it to the server ([[Uploading and Loading AssetBundles]] for more info).&lt;br /&gt;
  findplayer(&amp;quot;Graal5918039&amp;quot;).addweapon(this.name);&lt;br /&gt;
 &lt;br /&gt;
 //#CLIENTSIDE&lt;br /&gt;
 &lt;br /&gt;
 function onPlayerChats() {&lt;br /&gt;
   if (player.chat == &amp;quot;dev&amp;quot;) toggle();&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public function toggle() {&lt;br /&gt;
   (@&amp;quot;3D/Dev/AssetManager&amp;quot;).loadAssetBundle(&amp;quot;devtoolsui&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function onAssetBundleDownloaded(bundlename) {&lt;br /&gt;
   if (bundlename == &amp;quot;devtoolsui&amp;quot;) {&lt;br /&gt;
     this.keepAlive = true;;&lt;br /&gt;
     this.btns = {&amp;quot;inscpector&amp;quot;, &amp;quot;bundleexpl&amp;quot;, &amp;quot;console&amp;quot;, &amp;quot;camera&amp;quot;, &amp;quot;rendering&amp;quot;, &amp;quot;back&amp;quot;};&lt;br /&gt;
     this.devuiprefab = GameObject::fromassetbundle(&amp;quot;devtoolsui&amp;quot;, &amp;quot;assets/menuui/canvasdevtools.prefab&amp;quot;);&lt;br /&gt;
     this.devui = Object::Instantiate(Type::GameObject, this.devuiprefab);&lt;br /&gt;
 &lt;br /&gt;
     for (btn : this.btns) {&lt;br /&gt;
       temp.btn = Quattro::TransformExtensions::FindDeepChild(this.devui.transform, btn);&lt;br /&gt;
       Quattro::EventManager::AddEventHandlerTo(temp.btn.gameobject.GetComponent(Type::UI::Button));&lt;br /&gt;
       this.catcheventobject(temp.btn.gameobject, &amp;quot;onClick&amp;quot;, &amp;quot;onDevToolClick&amp;quot;);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     Object::Destroy(this.devui, 4);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public function onDevToolClick(go) {&lt;br /&gt;
   if (go.name == &amp;quot;inscpector&amp;quot;) player.chat = go.name;&lt;br /&gt;
   if (go.name == &amp;quot;bundleexpl&amp;quot;) player.chat = go.name;&lt;br /&gt;
   if (go.name == &amp;quot;console&amp;quot;) player.chat = go.name;&lt;br /&gt;
   if (go.name == &amp;quot;camera&amp;quot;) player.chat = go.name;&lt;br /&gt;
   if (go.name == &amp;quot;rendering&amp;quot;) player.chat = go.name;&lt;br /&gt;
   &lt;br /&gt;
   if (go.name == &amp;quot;back&amp;quot;) close();&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 public function close() {&lt;br /&gt;
   for (btn : this.btns) {&lt;br /&gt;
     temp.btn = Quattro::TransformExtensions::FindDeepChild(this.devui.transform, btn);&lt;br /&gt;
     Object::Destroy(temp.btn.gameobject);&lt;br /&gt;
   } &lt;br /&gt;
   &lt;br /&gt;
   temp.img = Quattro::TransformExtensions::FindDeepChild(this.devui.transform, &amp;quot;Image&amp;quot;);&lt;br /&gt;
   temp.anim = temp.img.gameobject.GetComponent(Type::Animation);&lt;br /&gt;
   temp.anim.play(&amp;quot;devtools2&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
We load the assetbundle the usual way: &lt;br /&gt;
 (@&amp;quot;3D/Dev/AssetManager&amp;quot;).loadAssetBundle(&amp;quot;devtoolsui&amp;quot;);&lt;br /&gt;
 function onAssetBundleDownloaded(bundlename) {&lt;br /&gt;
   if (bundlename == &amp;quot;devtoolsui&amp;quot;) {&lt;br /&gt;
'''''this.keepAlive = true;''''' is necessary for the weapon to keep checking for button clicks.&lt;br /&gt;
&lt;br /&gt;
We create and instantiate the canvas prefab.&lt;br /&gt;
 this.devuiprefab = GameObject::fromassetbundle(&amp;quot;devtoolsui&amp;quot;, &amp;quot;assets/menuui/canvasdevtools.prefab&amp;quot;);&lt;br /&gt;
 this.devui = Object::Instantiate(Type::GameObject, this.devuiprefab);&lt;br /&gt;
this will display the canvas on the client screen.&lt;br /&gt;
&lt;br /&gt;
To detect button clicks;&lt;br /&gt;
 temp.btn = Quattro::TransformExtensions::FindDeepChild(this.devui.transform, btn);&lt;br /&gt;
 Quattro::EventManager::AddEventHandlerTo(temp.btn.gameobject.GetComponent(Type::UI::Button));&lt;br /&gt;
 this.catcheventobject(temp.btn.gameobject, &amp;quot;onClick&amp;quot;, &amp;quot;onDevToolClick&amp;quot;);&lt;br /&gt;
we first find the button GameObject by name ('''this.devui.transform''' being the transform component of the canvas, and '''btn''' is the button name we want to find).&lt;br /&gt;
&lt;br /&gt;
Next, we add an EventManager to the button component of the GameObject we just found ('''temp.btn.gameobject.GetComponent(Type::UI::Button)''').&lt;br /&gt;
&lt;br /&gt;
And '''this.catcheventobject(temp.btn.gameobject, &amp;quot;onClick&amp;quot;, &amp;quot;onDevToolClick&amp;quot;)''' to catch all the onClick events.&lt;br /&gt;
&lt;br /&gt;
Finally, we implement '''public function onDevToolClick(go)''' to add functionalities after button is pressed (with '''go''' the GameObject being pressed).&lt;br /&gt;
&lt;br /&gt;
For animations, to add or play an animation, you will need to get the animation component of the GameObject first. (using: '''temp.img.gameobject.GetComponent(Type::Animation)''')&lt;br /&gt;
 temp.img = Quattro::TransformExtensions::FindDeepChild(this.devui.transform, &amp;quot;Image&amp;quot;);&lt;br /&gt;
 temp.anim = temp.img.gameobject.GetComponent(Type::Animation);&lt;br /&gt;
 temp.anim.play(&amp;quot;devtools2&amp;quot;);&lt;br /&gt;
(more script functionalities for animations available here: https://docs.unity3d.com/ScriptReference/Animation.html).&lt;/div&gt;</summary>
		<author><name>Julienm20</name></author>
	</entry>
	<entry>
		<id>https://graalonline.net/index.php?title=Uploading_and_Loading_AssetBundles&amp;diff=20952</id>
		<title>Uploading and Loading AssetBundles</title>
		<link rel="alternate" type="text/html" href="https://graalonline.net/index.php?title=Uploading_and_Loading_AssetBundles&amp;diff=20952"/>
		<updated>2021-10-20T10:12:23Z</updated>

		<summary type="html">&lt;p&gt;Julienm20: /* Uploading AssetBundles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Up until now, we have been using PrimitiveTypes for our GameObjects.&lt;br /&gt;
&lt;br /&gt;
In this section, we will start using different GameObjects. I will go over how to upload your assetbundles containing all your customized prefabs to the server. How to load, instantiate, and manipulate them.&lt;br /&gt;
===Uploading AssetBundles===&lt;br /&gt;
You will need to have Unity installed for this part.&lt;br /&gt;
&lt;br /&gt;
You will also need to have the “Quattro3D- Unity Project for bundle asset creation.7z&amp;quot; Unity project installed from : &lt;br /&gt;
&lt;br /&gt;
https://www.graalonline.com/downloads/file?name=Quattro3D-UnityProjectforbundleassetcreation.zip&lt;br /&gt;
&lt;br /&gt;
I will be going through an example, demonstrating how it’s done.&lt;br /&gt;
&lt;br /&gt;
Begin by choosing what prefabs you want to upload. In our case, I will upload a bomb and a character prefab, which I already have ready in a different project.&lt;br /&gt;
&lt;br /&gt;
Note: Remember you cant put scripts in your asset bundles.&lt;br /&gt;
&lt;br /&gt;
Open the Unity project downloaded (“Quattro3D- Unity Project for bundle asset creation.7z&amp;quot;). This project contains a script that builds the assetbundles and puts them in the Assets/StreamingAssets folder, which will hold all our uploadable files.&lt;br /&gt;
&lt;br /&gt;
In the Assets folder, I will create a new folder and name it Example.&lt;br /&gt;
&lt;br /&gt;
Next I will import my prefabs;&lt;br /&gt;
&lt;br /&gt;
In the top left menu hit (Assets&amp;gt;Import New Asset/Import Package). Go to the location of your prefabs and select them and press Import.&lt;br /&gt;
&lt;br /&gt;
[[File:Uploading assetbundles.png|frameless|371x371px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Prefabs.png|frameless|476x476px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Imported prefabs.png|frameless|773x773px]]&lt;br /&gt;
&lt;br /&gt;
Now that we’ve imported our assets, we’ll create an assetbundle to be uploaded to the server;&lt;br /&gt;
&lt;br /&gt;
Using the Unity way of creating assetbundles by flagging the prefabs:&lt;br /&gt;
&lt;br /&gt;
Select all the prefabs in the asset folder, the Inspector Window should open. At the bottom right of your screen, in the Inspector Window, create or select an existing name for your assetbundle.&lt;br /&gt;
&lt;br /&gt;
The bundle will embed all the assets/prefabs under that flagged directory. You can of course put multiple prefabs/files/subdir...etc inside an asset bundle.&lt;br /&gt;
&lt;br /&gt;
[[File:Adding a tag to the prefabs.png|frameless|541x541px]]    [[File:Tagging prefabs.png|frameless|541x541px]]&lt;br /&gt;
&lt;br /&gt;
Now build your asset by pressing on BuildAssetBundles&amp;gt;PackagesBuilder&amp;gt;buildAssetBundles in that project.&lt;br /&gt;
&lt;br /&gt;
The built asset will be stored in the downloaded Unity Project in “Quattro3D- Unity Project for bundle asset creation\Assets\StreamingAssets”&lt;br /&gt;
&lt;br /&gt;
[[File:Uploading assets to the server.png|frameless|712x712px]]&lt;br /&gt;
&lt;br /&gt;
The file that we’ll use to upload to graal should end with “.txt”&lt;br /&gt;
&lt;br /&gt;
[[File:Uploading to the server.png|frameless|800x800px]]&lt;br /&gt;
&lt;br /&gt;
Finally to upload the asset to the server, login on rc, go to levels/assetbundles and drop the “.txt” file there.&lt;br /&gt;
&lt;br /&gt;
It should be automatically downloaded to /Users/”yourusername”/AppData/LocalLow/Graal Worlds/Levels3d/assetbundles[[File:Uploading assets through rc.png|center|frameless|477x477px]]''You’re strongly advised to generate a unitypackage too when you generate an asset bundle and upload it to the server, so that everyone can rebuild the bundle on every platform.''&lt;br /&gt;
&lt;br /&gt;
To view your asset and your prefabs, login to the Client, hit F10 to open the Bundle Explorer and search for your asset name.[[File:Bundle explorer.png|center|frameless|768x768px]]&lt;br /&gt;
===ClientSide Loading Assets===&lt;br /&gt;
Now to load your prefabs using GraalScript; to your code add the following:&lt;br /&gt;
&lt;br /&gt;
You can use the Bundle Explorer (F10) to copy the path of the AssetBundle.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|findplayer(&amp;quot;Graal5918039&amp;quot;).addweapon(this.name);&lt;br /&gt;
//#CLIENTSIDE&lt;br /&gt;
&lt;br /&gt;
function onCreated() {&lt;br /&gt;
&lt;br /&gt;
  (@&amp;quot;3D/Dev/AssetManager&amp;quot;).loadAssetBundle(&amp;quot;documentationexample&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function onAssetBundleDownloaded(bundlename) {&lt;br /&gt;
&lt;br /&gt;
  if (bundlename == &amp;quot;documentationexample&amp;quot;) {&lt;br /&gt;
&lt;br /&gt;
    player.chat = &amp;quot;example loaded&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    temp.prefab = GameObject::fromassetbundle(&amp;quot;documentationexample&amp;quot;, &amp;quot;assets/example/bomb.prefab&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    this.bomb = Object::Instantiate(Type::GameObject, temp.prefab);&lt;br /&gt;
&lt;br /&gt;
    this.bomb.transform.position = v3(player.x + 5, player.z, player.y);&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
|}[[File:Loading prefabs.png|center|frameless|406x406px]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!(@&amp;quot;3D/Dev/AssetManager&amp;quot;).loadAssetBundle(&amp;quot;documentationexample&amp;quot;);&lt;br /&gt;
|}&lt;br /&gt;
The above method loads and downloads the AssetBundle.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! function onAssetBundleDownloaded(bundlename) {} &lt;br /&gt;
|}&lt;br /&gt;
And Implementing the '''''onAssetBundleDownloaded''''' will make sure the Assetbundle has been loaded. We could've skipped this step and directly created the prefab, but best is to make sure the Asset has been loaded.&lt;br /&gt;
&lt;br /&gt;
We then create a prefab:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!temp.prefab = GameObject::fromassetbundle(&amp;quot;documentationexample&amp;quot;, &amp;quot;assets/example/bomb.prefab&amp;quot;);&lt;br /&gt;
|}&lt;br /&gt;
instantiate it,&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!this.bomb = Object::Instantiate(Type::GameObject, temp.prefab);&lt;br /&gt;
|}&lt;br /&gt;
and give it a position in the scene:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!this.bomb.transform.position = v3(player.x + 5, player.z, player.y);&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Julienm20</name></author>
	</entry>
</feed>