Introduction: Robo Recall Mods - Firearm Tutorial
Hello everyone! Welcome to Art Inferno! I’m Robbie, also known as Firestorm, and today I’ll be your guide on this tutorial for the game Robo Recall!
This Instructable is all about Robo Recall, a game for the virtual Reality Headset the Oculus Rift. The game’s built in Unreal Engine 4, which features mod support. What we’ll be doing today is creating a mod for the game which will feature a custom weapon we add to the game. In order to do this, we’ll be doing several things, including:
Finding a free, creative commons model on sketchfab
Editing that model in Blender to free moving parts and add a skeleton .
Exporting the model as an fbx for use in Unreal Engine 4.
Importing the model, it’s skeleton and physics colliders, and textures into UE4 .
Editing the physics collider and skeleton to make them compatible with Robo Recall.
Adding a material for the weapon to apply textures to.
And scripting events in UE4’s Blueprint system to animate our weapon and change gun settings.
This Instructable was created as a companion to my video tutorial on Youtube detailing all these steps, so if you would like to read yourself and watch a video detailing everything you need to know that way, the link to the video will be posted here once it goes up:
Alrighty so let get started!
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Downloading
The first step is finding a weapon model that we can use for this mod. An easy way to find a weapon model is to visit the website Sketchfab.com. It's an awesome website that hosts millions of free 3D models that people upload themselves. They have a very wide range of weapon models to choose from, so we'll pick one out there for this tutorial.
Figure 1-a displays the main search bar of Sketchfab, with "MP7" in the search bar. Also make sure the "downloadable" button is clicked and checked, and then select the MP7 model with the sad face out from the list.
After the model loads completely, a pretty detailed model is displayed, including textures and a nice normal map, which is good for this tutorial, since the weapon should look as real as possible for the game. Left click and drag on the model like figure 1-b to view it from different angles and look it over to make sure it’s not missing any faces or anything.
NOTE: (I’ve already previewed this model for the purposes of this instructional video though, so we’re good.)
To download, scroll the page down to the model’s description! This model was created by the user AvnisT.
NOTE: (If you like this model make sure to check out the rest of his stuff!)
To download, click the blue “download” link underneath Avnis’s profile picture and make sure to choose the obj format for download (the other option is a web model format, and Blender can’t import that, so make sure to grab the right one) and pick a save location. Once it completes the download, we have finished this step! Onto the next.
Step 2: Editing
Now that the model is downloaded, unzip the file in order to grab the obj and textures. To do so, find the .zip file downloaded in the file browser, right click, and choose “extract all”. Then click the “extract” button in the prompt that pops up.
Now inside the folder that we just created there are two folders: “textures” and “source”. Click on source to find another .zip file. Right click on that zip and choose “cut” and then past it in the same folder as the textures folder. Then delete the “source” folder, and Extract this new folder in it’s place.
Now inside the textures folder there is a material texture and a normal map. We’ll need both of those later, but for now, open the mp7 folder just extracted and find a file named “mp7.obj”. That’s the file to edit!
Now in order to edit this model, we need a model editing program! This tutorial uses Blender, a free, open-source modelling and animation software that can be downloaded right off the internet!
NOTE: (If you already have Blender installed on your computer, Scroll down to the subheader for Blender)
To download it, go to an internet browser and type in blender.org. On the main page for their site (should look something like figure 2-a), there should be a big blue button that says Download Blender, along with whatever the newest version of Blender is. Click on that and it will then load a page with the download type for your computer at the top in a big green button. Click it to download.
The .msi file will take a few seconds (or a few minutes) to download depending on your internet speed, so just stay patient until it finishes. Then click on the file to run the installer, and follow it’s prompt until Blender is installed! Then open it.
When Blender first opens, it should show a splash screen with an image of a recent big creation using Blender, just click on the viewport (the middle view with the white grid behind it) to get rid of it.
See that the scene starts with a block in the middle. Hit x and enter to delete it. Then, import the new obj model that we just downloaded by clicking the file tab in the upper left, choosing the import option from the list, and then obj in the small list that pops up to the side.
Then, to quickly find the model in Blender’s file viewer, go back to the file explorer where the obj file was open, and click on the bar at the top that shows the folder’s name. It should highlight a string of text in blue. Copy that by pressing the keys ctrl and c. Then in the address bar inside of Blender, click on it to highlight everything, and press the keys ctrl and v to paste that location, and hit enter to send Blender’s file viewer to that folder.
Because of importing an obj file, only the obj file from the folder should be viewable in the list. Click on it and hit “import obj” in the top right corner to import it.
You should now see a white-grey version of the model from Sketchfab inside of Blender. Quickly right click on the model to select it and press shift+ctrl+alt+c to enter the origin menu and click the “geometry to origin” option to recenter the object.
NOTE: (Now, I’m going to quickly go over the steps for editing model, so if you’re new to blender I have some links in the description of the youtube video to videos and documentation detailing all of the tools in Blender I’ll be using for this tutorial, because most of it is cursory information for most experienced modelers.)
First, check if the parts are separated. To do that, right click on the model anywhere. You’ll see that like figure 2-c, the entire model is surrounded by a yellow outline. We need the trigger separate, and we need to separate the slide and slide door on the gun so it will move back and forth when the gun fires. To do that, enter edit mode with the tab key and zoom in on the slide door ( the big open spot above the grip on the right side of the weapon) to make it easier, press 5 on your numpad to go into orthographic mode, and press 3 and 9 on your numpad to view the right side.
We then need to use face select mode to select the two faces on the slide cover. Click the cube down in the toolbar below the viewpoint with an entire side lit up orange to enter face select mode, and click on one of the two faces, and then shift click on the other face to select them both. Then press p in the viewport to bring up parenting options, and click the “selection” option to separate those two faces into their own object in Blender. You can now see that if you click and drag on the green arrow back in object mode with the slide object selected, it moves back and forth on its own without moving the rest of the gun.
You can also see that by separating those two faces, we’ve now exposed a bit of the inside of the gun. To fix this, press the H key while having the slide selected to hide it, and select the gun model again. Go back into the edit mode for the gun model and select those faces that look messed up now and delete them by pressing x and “Delete faces”. Repeat that until the little cylinder inside the model is gone, making sure not to delete the second set of back faces so you’re left with a nice, clean cavity for the bullet shells to go into. Then go back to object mode and press alt + h to unhide the slide again.
We also need to separate the slide of the model so it can move separately. Move your viewport so you can see the slide (coming out above the back stock of the gun) and press the z key to enter wireframe mode. You can see more of the slide exists inside the model that we can’t see without wireframe mode on. Select it all (being careful not to select parts on the main gun’s body) and separate it as well. You may find once you think you have everything selected, if you press g and move the selection, it’ll be dragging a piece of the main model’s mesh with it. To fix that, simple enter line select mode down at the bottom (the cube with one orange line) and deselect those edges.
The trigger is the easiest piece to separate. Since it’s already its own “island” inside the mesh (meaning none of its faces connect directly to the gun model’s, like figure 2-d) simply select a face of the trigger, press L (island selection) and it will automatically grab all the faces of the trigger. Then just press p and “selected” to separate the trigger!
Now that the trigger, the slide, and the slide door are all separate, we need to rig them! To start, we need to reapply the origin movements, so double tap a to select everything from object mode, and press the shift+ctrl+alt+c keyboard shortcut again (like figure 2-e) and select “origin to geometry” to realign each object’s origin to it’s geometry. Now we need to create the bones for the “armature” that will control our mesh in Robo Recall! To do that, press 3 to go to the side view.
Then select the gun model with the handle and enter edit mode. We need to select two faces that are in the same location on both sides of the handle so the bone we create will be in the middle of the gun. Once you have both face selected, press shift + s and click “cursor to selected” to put Blender’s 3D cursor at our selection. Then exit edit mode and go back to our side view.
Now, hit shift+a to bring up the add menu, and select “armature, single bone” to add an armature bone to the scene, although you shouldn’t be able to see it right now. That’s because we need to enable x-ray mode. To do so, in the menu at the right choose the Armature tab (the icon with the little man in T-pose). And click on the checkbox that says “X-ray”. Now you should be able to see the little bone we just made, a little teardrop shape with a ball on either end (referenced in figure 2-f). We need to add a few more bones to this armature, but first we need to name this bone, enter edit mode and then click on the bone tab on the right (the icon with the bone by itself).
The dialog box at the top of the menu should say “Bone” click on that text, delete it, and enter “Handle” instead, since this is the handle bone. We then need to create bones for the Trigger, slide, and slide door. To do so, exit edit mode, select the object you’re going to add the bone for, press shift+s and choose “cursor to selection” and then reselect the bone, enter edit mode again, and press shift+a again to add a new bone at the location of the 3D cursor. Then select that new bone and in the tab at the right give it the name of whatever object it will be moving “trigger, slide, or slide door”. Repeat that process until all three other objects have their own bone!
One thing we’ll need to do before moving on to the next step is move the trigger bone. The trigger rotates instead of moving, so we need to move the bone to the top of the trigger so it’ll act like a rotation joint for the trigger. Select the trigger pbone and press g to move it, and place it above the the trigger, right where it intersects the gun model, and left click to place it there.
So now we have all those bones but currently they aren’t attached to each other, which means that everything still moves by itself. We need to parent each bone to the handle, so that when the handle moves, everything else moves with it. To do that, select a bone and shift select the handle bone, press ctrl + p to bring up the parent menu, and choose “keep offset” to parent the bone without moving it. Do that for all three bones.
Awesome! So now our armature is completely connected, and moves together the way it should. Now we just need to parent the model pieces to it, so they move too! Press ctrl+tab to enter the rig’s “pose mode” which will allow us to select individual bones and attach mesh pieces to them!
Select the handle bone, then click the handle’s model and then shift click the handle bone again. Then. with them both selected, press ctrl + p to open the armature menu and select “bone”. The bone armature option will rotate and move the gun, but not deform it, meaning if we move another bone without moving the handle, it wont bend the model. Do the same thing for the magazine, using the handle bone, so it will move with the gun. Now repeat this process for the other three bones and models.
If done correctly, at the end of this process, you should be able to select the handle bone, hit g and see the entire model move together!
Now would be a great time to save your blender project! To do so, click the file tab and select “save as” and then save it in the folder of your choice.
Now that our model is rigged and has an appropriate armature, it’s time to export the model! To do so, go back to object mode, select both the camera and lamp, and press h to hide them both. Then tap a until everything is selected,and save really quickly so we don’t lose our progress. We need to have one object be the active selection to export, so shift+click the main gun model to highlight it. Then, in the file tab, click export, fbx. Down in the lower left hand corner of the new screen, make sure to check the box for “selected objects” and then save the fbx file where you want it!
Step 3: Import
Now that we have a finished, rigged model for our weapon, we need to bring it into UE4 to be used as our weapon in Robo Recall! Now, there’s a very specific version of UE4 that you’ll need for this tutorial, so go ahead and open up the Epic Games launcher (if you're new to UE4, it's the same launcher used to launch Fortnite) and then select the “modding” tab at the top. Then in the menu to the left choose Robo Recall and install it (the same button as in figure 3-a). It’ll take a while, it’s about 10 Gb's of data it has to download, so make sure you’re using a solid internet connection!
Then when it’s finished, click Launch to open the mod editor! (This will also take a minute)
Once it loads you’ll be greeted with a “New game mod” screen. This tutorial assumes you have some basic knowledge of the layout of Unreal Engine, but this screen is new for modders too, so I’ll explain this.
The mod window is essentially your “window” into making any mod of robo Recall. They have categories for each weapon, your VR hands, each enemy type, several example maps, and some blank mods for using code. What we want to choose is the “custom Pistol mod” option. Click it to select it from the list and give it a name in the name slot down below. Once it’s named, click the “Create mod” button to make your mod.
Now, currently you should see a Blueprints folder. If you open it, there’s a weapons folder inside, that holds your mod’s weapon blueprint. We’ll be using that later but for now, back in the content folder, right click on an empty space in the content browser and select “import to *insert folder name here*” then find our fbx file and click open.
This should bring up a new dialog in UE4. It has a lot of options (check figure 3-b), but all we need to do is click the box named “skeletal mesh” to check it, and then click “import all” to import the mesh, it’s physics asset, and it’s skeleton (the armature we created in Blender). It’ll pop up a message log, just close it.
Now you can see we have those three new items, but they all have a small grey star in the lower left corner of their preview images. That means they aren’t saved. We need to save them so we don’t lose them when we close the app. To do that, double click each one to open their window and hit save on each one. Then back in the content browser, choose import again, find both images we need, and import them, saving the same way we did the mesh items. You can close the textures when they’re saved, we don’t need those windows.
Step 4: Skeletal
The next thing we need to do is edit the physics asset so it will work correctly for robo Recall. Go to the physics asset’s tab.
When you first open it, you’ll have to move the viewport and you’ll see the entire gun is surrounded by pill shaped purple lines. Those are the guns’ current hitboxes. We don’t want pill shaped ones or the gun will never stop moving, so in the heirarchy to the left of the viewport, right click “Armature” and click “delete all bodies below” to get rid of the pills. We then need to replace those pills with a couple cubes. The easiest way to start is from left view in this case, so click the second menu in the top left of the viewport and choose left and then zoom back in.
Then, under handle, should be a component labeled “SMDImport”. Select it and right click and select “add new body”. In the pop up dialog uncheck “orient along bone” and then click the dropdown for “Collission Geometry” and select “cube”. Then hit ok. That should make a box about the size of the gun, but we want this box to just surround the barrel, so click the box with the two arrows in the top right to enter scale mode and scale it until it doesn’t touch the should pad and is only as tall as the barrel. You can also press the w and r keys while the box is selected to go back and forth between movement mode and scale mode to line the box up with the model. Then in the heirarchy, right click and add another box on SMDImport. Scale this to the handle, and repeat until every section of the model has an appropriately sized box in this view.
Now we need to make sure they’re the proper size at all angles, so go back to perspective and scale the boxes to the guns from every angle.
Figure 4-a should be about what it looks like in the end.
The last thing we need to do here is enable collisions. In the menu to the right, there’s a collision section. Check both “Use CCD” and “Simulation Generates Hits”, and then save. (reference figure 4-b) Without "Generates Hits" and CCD on the robots wont detect when the weapons hit them when thrown. You can then close the physics asset, as we won’t need it open anymore.
The next thing we need to edit is the model itself. In order for the gun to feel right in the hand, we need to scale it so it’s about the same size as the weapon currently in the game. To do that, we need the mesh itself open (which we already have) and we need to open that weapon blueprint that’s in the weapons folder. When the weapon blueprint opens, make sure you can still see it’s window as well as the content browser. Go back out to the main folder and select your mesh item by clicking it once.
Then, in the mod blueprint ,select the item from the Component hierarchy called “WeapMesh”. When you do, the menu on the right should change to show a new menu, with a category called “Mesh”. Click the arrow to use whatever is selected in the browser as the mesh, in this case our MP7. You should now see our MP7, using the previous pistols textures, in the view-port. However, it’ll be WAY too big, and rotated 90 degrees the wrong direction. To fix this, and change the import settings. (Figure 4-c displays all recommended import changes.)
Now that our weapon is the right size and in the right place, we need to make a slight change to it’s skeleton so it will shoot bullet casings out the side. Go to the skeleton window, and zoom in on the model. We need to create what’s called a socket. A socket in UE4 is essentially a point on an armature that you can attach other objects to.We need one on our main model (main so it doesn’t move when the slide or trigger moves) so select the Handle, right click, and choose “Add socket”. Name the socket “Shell_Socket” (this is important, because it’s the name of the Socket that the shell component spawns at) and hit enter to make it!
Now currently it’s much too big, and it’s in the handle instead of inside that opening for the bullet casings, so we need to move it and scale it to fit. (again this can be done easier from an orthographic view, front in this case. You'll have to flip back and forth between the skeleton window and the mod window (which you should put the view-port into wireframe mode for) because the bullet casing can be easily seen as a purple outline in wireframe mode.
(Figure 4-d shows transforms for Shell_Socket socket.)
Step 5: Material
Now our weapon needs its own material. To add one, right click in the content browser and choose Material in the “Create Basic Asset” section.
Name it MP7ALL and hit enter to create it, then double click to open it.
That will open a window with a sphere and a blueprint area with a grid and a brown node that says “MP7ALL”. To use our two textures, drag them both from the content browser into the grid and release them. Then drag a wire from the color texture’s white circle by clicking and dragging and move that wire to the “Base color” circle on the MP7ALL node. Do the same for the normal texture to the “Normal” circle, then hit Save.
(Should look like the connections of the red and blue nodes of figure 5-a.)
Then go back to the mod blueprint and in the slot for materials in the WeapMesh component, hit the arrow with “MP7All” selected in the content browser to apply it to our weapon. It’ll take a few seconds to change in the viewport (when it finished, it should look like figure 5-b). Make sure to compile and save both the mod blueprint, and the MP7ALL texture, and then we can click “Play” in the mod blueprint (or the main window’s menu) and put on our headset to try it out for the first time!
Once you load the mod into your active mods section in the main menu in the test level, you’ll notice a few things:
No parts of the weapon move.
The weapon reverts to the pistol material to dissolve when dropped like the Robo Recall weapons.
The muzzle flash occurs inside the weapon, too far from the end of the barrel.
The next few steps will cover the fixes for all of those! For now, we’ll focus on making the gun dissolve. Dissolving is handled by a material that the devs for Robo Recall created, and we just need to copy the nodes from that material into our own material for dissolve to work. In the content browser, scroll up to the top of the folder view and select the content folder. This houses all the things the software uses to make mods. Now in the content browser, search for “weapon_master”. A material called M_Weapon_Master should show up. Double click it to open. (refer to figure 5-c for clarification.)
We’ll need to zoom out to see all the different parts of this. There should be a box called “Dissolve” (referenced in figure 5-d). Left click and drag a box around that box to select it and everything inside, and then copy it.
Then quickly exit out of that material, without saving, as we don’t want to mess it up.
We then need to paste what we copied in our own material. And move it so the right end is next to our MP7ALL node. There should be two nodes at the far right of that box: A Multiply, labeled as Hotline, and the UseDissolve node. Drag a line from Multiple to Emmisive Color on MP7ALL and drag a line from UseDissolve to OpacityMask on MP7ALL, and save. (referenced in figure 5-e)
Now that added all our dissolve code, but we need to activate it. To do that, right click the MP7ALL material in the content browser and click “create material instance”. Then change the “Inst” to “Dissolve” (or leave it, it doesn’t make any difference) and hit enter to create a material instance. Then open it.
In the new window, on the left, is a menu with several disabled items. We need to enable 4 of them:
(referenced in figure 5-f)
Use Dissolve and it’s secondary checkbox
And Blend Mode
Once you have all of those enabled, change the Blend Mode in the dropdown to Masked and hit Save. Then wait for the popup in the right bottom corner that says “Compiling shaders” to finish and save again. Now if you click and drag across the numbers for Dissolve, you’ll see a blue light fade across the material and hide it. Make sure to set Dissolve back to -1 and save and exit. (you can use the yellow arrow to the right of any changed variable to reset it to it’s default.)
Now back in the mod Blueprint, go to the MP7_V1Pistol(self) component and search for “dissolve” in the menu to the right. Then select the instance in the content browser and hit the arrow next to “Dissolve Material” to use that instance as the dissolve material. (referenced in figure 5-g) Then compile and save, and if you choose to test again, like I will, you’ll see that once the gun is out of ammo and you drop it, it will dissolve away like the guns in the base game. And that’s it for our Material, it’s completely done now!
So now onto the final two steps, animation and blueprinting!
Step 6: Blueprinting
In order for our mod to act more like the MP7 it looks like, we’ll need to change a few things. First, the MP7 can hold a maximum of 40 rounds in a box mag, and although we are obviously using a magazine here, not a box magazine, I tend to use the higher ammo counts as it lends itself better to shooting in VR.
So in the top right menu in the self component, search for ammo. Youll see that both Ammo Remaining and Ammo Capacity are currently 20. Ammo Remaining is the ammo left in a weapon grabbed off a defeated enemy, while Ammo Capacity is the ammo in the weapon you spawn at your belt. Change those both to 40 and save if you want more ammo in your weapons. (referenced in figure 6-a.)
Then search for refire. There should be an option under the Weapon category called Auto Refire. Check it’s box so the weapon will fire in auto mode. We’ll also want to change the Refire Time to .063, the time it takes for an actual MP7 to fire on average (used some math from the wikipedia article on MP7’s to get that number). Then compile again. (referenced in 6-b.)
The last thing we want to search for is recoil. In the Default category, there should be an option called “Dynamic Recoil”. This is the multiplier for how stable the weapon is. Since it’s an smg and we want it to fire pretty straight, something from .3 to .4 would work fine there. Then compile and save again.
Now if you test out the mod, it’s looking much better, but there’s two things left to fix. The animations, obviously, but also out muzzle flash is still inside the gun. To fix this, we need to create a new component for Muzzle flash to move to on the weapon. Go into front view and with the self component selected, click the Add Component button and choose Scene. This will create an empty object with transform values but no geometry so you wont see it in-game. Name it Muzzle. We’ll use this object to move the MuzzleFlashFX component inside Blueprint.
Using the arrows, move the Muzzle component so it’s three or four blocks in front of the barrel from front view, zoomed in to the 10cm mark. While zoomed in all the way. (or in the menu to the right, set the transform location to 37.38, 0, and 6.97) (referenced in 6-c.)
Then click over to our Event graph. This is where all the code for our mod will go. We want to move the muzzleflashfx component only when the gun is firing, so right click in an empty area and search for Event fired and choose Event Notify fired. Now currently, this node we just created would stop the gun from firing entirely. To fix that, we need a call to it’s parent function. Right click on the new node and select “add call to parent function” and it will add in a orange Parent:Notify Fired node. We’ll connect those two up later, but for now, drag the MuzzleFlashFX component into the Blueprint Event Graph.
This will create a reference to the object we need to move. Put that node close underneath Notify Fired and drag a line out from it’s circle and search for “Set Relative Location” to get a node that can move the MuzzleFlash FX component. Now we just need somewhere for it to move to! Drag in a reference to Muzzle, then drag a line off it’s circle and search for “get relative location” to get an orange node that represents the Muzzle empty’s location in space! Then connect the output of that new node to the orange input of “SetRelativeLocation” so that MuzzleFlashFX will move to muzzle’s location! Also check the box next to “Teleport” so it moves there right away, not over time. Then connect the output arrow of Event Notify Fired to the Input of Set Relative, and the output of Set Relative to the input of Parent, compile and save. Now when you test it out, the muzzle flash should come from the right spot. (all code referenced in figure 6-d.)
Step 7: Animation
Now all that’s left to do is animate the model so that the slide, trigger and slide door all move accordingly. To do so, right click in the content browser and under the animation tab choose Animation Blueprint. In the new window that pops up we need to select a skeleton so on the search bar halfway down the window search for MP7 and hit ok to create the Anim Blueprint. Then name it MP7ANIM and hit enter to name it, and then double click to open it.
(icon referenced in figure 7-a)
Now, an anim blueprint is made of two sections: One, the anim graph, (figure 7-b) where the bones move and the “pose” for the model is set, and the Event Graph, (figure 7-c) where the anim blueprint gathers information from the rest of the scene.
(All code explained here in figure 7-c) Starting in the Event Graph, we need a new node. Right click and search for Blueprint Initialization. Select Event Blueprint Initialize Animation and click it to create that node. This event will only happen once when the Blueprint starts animating. Next, search for “get owning actor”. Then drag a blue line off the Return Value and search for Cast to MP7. Create the node “Cast to MP7_V1Pistol” (the MP7_V1 is my own mod’s name, it’ll look a bit different if your mod is named something else) connect the output arrow of Initialize to the input arrow of Cast, and then right click the blue output to Cast and select “promote to variable”. It’ll then create a new variable and a new “set” node. Rename that variable as “mygun” to make it easy to see.
Now from the variables tab on the left drag in a reference to “get mygun” and then drag a wire off and get both “get trigger pull” and “get slide recoil”. Make sure to grab the variable versions of both of these, not the functions.
Now drag a wire off the output of Trigger Pull and search for Lerp (rotator). Both Trigger Pull and Slide Recoil go from a value of zero to one, meaning that as those values (which are controlled by actions in-game) move from zero to one, we want to rotate the trigger from one set angle to another, and move the slide and slide door from one place to another. To figure those out, open the skeleton by clicking it’s icon in the top right of the screen.
Select the trigger bone from the hierarchy and zoom in on it. You’ll see that even though the circle you think we’d want to move on is the green one, or y, the axis it’s rotating is actually the x axis, so we’ll need to remember that as we move the bone, even though the widget will be moving in y. I found that moving it back to around 28 degrees from zero was good enough, so put that in the B X value for the rotator Lerp. (make sure to set each transform you change back to it’s original value with that yellow arrow, or it’ll mess up our animation) then right click on the Return Value for the Lerp rotator and promote it’s output to a variable as well. Name it something like trigger for easy labelling.
For slide recoil, we’ll need two different Lerps. Both lerp vectors. The reason is the slide door will need to move much farther than the slide will. Back in the skeleton window, find the slide_door bone we set up and you’ll notice the axis we need to move is the Z axis. Now it starts off at .77 and I think moving it to about -3.30 is a good distance, so subtract .77 from 3.3 to find the positive version of the number we need, or about -2.53. Place that number in B’s z value for the first Lerp vector and promote it to a variable called Door.
The last vector we need to set is for the slide bone. It starts at -4.6, and moving it back to -5.42 seems correct. That gives us -1.22 we need to move backwards in the z axis. Place that number in B’s z axis for the second Lerp vector and promote that to a variable named “slide”. Now would be a good time to save your progress, so hit compile up at the top.
(All code explained here referenced in 7-b) Now in our Anim graph, we need to make those variables we created move some bones, so search for modify bone. Choose Transform (Modify) Bone and created 3 of them (pressing ctrl + w will duplicate a selected node).
Instead of output and input circles, modify nodes have pictures of a blue man standing straight up. Connect wires so they flow in a chain, connecting the last blue man to the white man icon on the Final Animation Pose node. This will insert a “component to local” node in between those two, because the animation to this point has been in bone space, but Final Animation Pose only sees Local space, so that one little node converts them. Then bring in a get reference to trigger, door, and slide. Connect the trigger to the rotation input of the first node, door to the translation of the second node, and Slide to the translation of the third node. Then go back to the first modify node and in the rotation category in the menu to the right, change Rotation Mode to Replace Existing and the Component Space to Bone space. Due the same for the other two, just in the Translation category instead of the rotation category. Then we need to pick bones for each Modify node to change. In the first modify node, in the skeletal control category, choose our trigger bone, in the second modify the slide_door bone, and in the third node the “slide” bone. Then compile and save.
This almost completes our mod! All that’s left is to apply that anim blueprint to our mod blueprint.
Go back to the WeapMesh component in our mod blueprint and search for anim at the right. Anim class should currently have nothing in it’s dropdown. Select our anim blueprint in the content browser and use the arrow next to the anim class dropdown to apply our anim blueprint to it. Then compile and save!
Step 8: OPTIONAL STEP
The final thing we can do is something that’s just a quality of use piece. Currently robo Recall has two basic grabbing interactions: One that grabs the gun itself, and a second one that uses the off-hand and can slide the slide back and forth when grabbed. Currently the collision box for the secondary interaction is where the slide for the old pistol was, so we need to move it and scale it so it matches where the slide is and can go now. To do so, we’ll be doing something similar to what we did for the MuzzleFlashFX. With the self component Selected, make a new scene component and name it second. We’ll come back to it later.
Now in front view in the viewport, select the Secondary Interaction Component in the hierarchy and move it to where the new slide is, and write down it’s location (in the menu on the right). You’ll need to know this so we can set the second scene component to that location later ( I found -18.46, 0, and 11.89 to be good). Then scale it so it covers just a bit more than the area that the slide moves. (I found 0.54 in the x and 1 in the z to be fine.) Then go back to perspective and scale it in y so it covers a bit more than the slide again. (1.7 in y looks good to me).
(All transforms referenced in figure opt-a.)
Now, once you have all those numbers down, reset the component back to it’s defaults, and put those numbers in the same places on the second scene component.
Now in the event graph drag in a reference to second and put it underneath the “parent: tick” node. Then grab a reference to Secondary Interaction Component as well. Drag wires off Second and get it’s relative scale and relative location. Then drag wires off Secondary and search for “Set relative scale” and choose the Set Relative Scale 3D node, and connect the output of Second’s relative Scale 3D node to the orange circle on Set Relative Scale 3D. Then drag another wire off of Secondary Interaction Component and search for Set Relative Location., setting it up with Second’s relative location the same way we did the muzzle. Then connect up all the arrow wires, starting at Parent: Tick to Set Relative Scale 3D and then from Set Relative Scale 3D to Set Relative Location. Compile and Save, and now the interaction component should be in the right place and the right size all the time.
(Nodes explained here referenced in figure opt-b.)
Step 9: Exporting
Now the last step to making your mod is exporting it to a .robo file (essentially a .exe file for Robo Recall) so that you can play it in the normal game!
To do so, go to your main mod window, with the view of the hub level, and in the middle, the bar above the viewport should have a button to the far right called “Share mod”. (referenced in figure 8-a) Click on that to bring up a dropdown of all the available mods (mine has a lot, yours should only have two or three). Select your mod from the list, which right now should be at the bottom of the list, and if the engine needs you to save anything, it’ll ask you to, just hit save all and it’ll bring up an output menu, called “Browse for Folder”.
It’s a bit confusing, but if you just put it somewhere well known to you, like your documents or your desktop, it’ll be easy to find. I’m putting mine in my Robo Recall modding folder in Documents.
To avoid confusion, I’d recommend making a new folder in whatever location you plan to make your mod and then exporting to that new folder (I generally name my export folders with the version of the mod I’m exporting, so V1, V2, etc etc.) then just wait for the packer to finish, it’ll make a little blipping noise when it finishes, and then run the .robo in that folder to install it to Robo Recall’s plugin folder, and then hit play inside the .robo’s dialog or in Oculus Home to start Robo Recall and play with your mod!
If you’re using this tutorial to update a mod you’ve already made, and overwrite the previous mod .robo file, make sure to find the Robo Recall plugins folder and delete the previous mod, as the editor is currently broken and sometimes wont change the version number of updated mods, causing them to not get reinstalled.
I hope you enjoyed my Robo Recall firearm Instructable! I'll be refining it and adding to it over the next little bit, but I hope you can take it from here and make your own amazing weapons for Robo Recall! I'll see you in the field, Agents!