Devlog #6: Creating Interactive Objects with Blueprints
Hello, this is Warren McClain. I’m considered an artist for this project but I’ve also done several years of programming work so I contribute to the scripting when I’m able to.
Something we realized early on in development is that the player will get stuck if they don’t have an instinct to explore and interact with the environment. To encourage this behavior, we had to acknowledge and support it as much as possible. So, when we decided that the game development office would be the setting for our introductory level, we came up with a list of objects that would reasonably be found in that environment. These objects needed to be scripted to have intuitive interactions with the player. But they also must not be so complicated that sensitive elements, such as the player controller, would need to be heavily edited and potentially break more pertinent features, such as the world-switching mechanic. This list eventually included objects such as a microwave, a refrigerator, a safe, and a vending machine. Unreal 5’s Blueprint visual scripting system allowed for these objects to be quickly prototyped, tested and refined one after another. To demonstrate, I will walk through the process of creating an interactable door object for the office map.
The first step is to retrieve a scale reference for the player character. The player fits comfortably in a 100x100x200cm block. This block can be created with CubeGrid and exported as an .fbx file to be later imported to a modeling program.
When modeling the prop, the objects that will animate must be modeled separately, such as the door and the door frame.
When importing meshes to Unreal, the pivot points of the meshes might be in unexpected locations. This can be fixed in Unreal by dragging the object out into the scene somewhere. Then select the object, and switch to Modeling Mode. In the sidebar, click XForm, then click Edit Pivot. Look down to Box Positions, and click the buttons there until the pivot point is in the desired location.
The desired location will change depending on the model. For static objects, such as the door frame, the “Bottom” option is usually fine. For objects you want to swing open, such as the door itself, you’ll want to put the pivot point on the far edge, away from the doorknob.
Now we create the blueprint. The blueprint for this object contains a Static Mesh for the door, a Static Mesh for the door frame and a Box Collision to check if the player is nearby.
The event graph is where the bulk of the scripting is done. In this case, two nodes are retrieving data from the Box Collision. One to check if something has entered the box and one to check if something has left the box. In the middle is a Timeline node, that ticks down from 0 to -100 in 0.4 seconds.
This value change is used to drive the action of the door swinging open on the Z axis.
When placed in a scene, the door blueprint should swing open when the player approaches, and close once the player walks away.
Interactive objects such as this can help turn static scenes into living environments. They don’t necessarily need to provide a systemic effect or benefit. Simply allowing the player to interact with props in the environment in a way that’s intuitive and believable can go a long way to make their experience with the game more memorable.
Can you come up with any other objects that could be made interactable with this method? How would you go about implementing sound effects or particle effects to this blueprint? Let us know in the comments and thanks for reading.
Edge Case
A surreal adventure through a lost developer’s unfinished work.
Status | In development |
Authors | Samantha, thedevnamedben, FlynnCooper, Amerhane, JacobWaugh, wmcclain |
Genre | Adventure |
Tags | 3D, Atmospheric, Indie, Metroidvania, Narrative, Short, Singleplayer, Unreal Engine |
Languages | English |
More posts
- Devlog #5: Resaltado y prompt de interacción. Español/Spanish version.3 days ago
- Devlog #5: Interaction outline and prompt5 days ago
- Devlog # 4: Construyendo el Mundo Real con Modelado y Texturizado de Props5 days ago
- Devlog #4: Building the Real World with Prop Modeling and Texturing12 days ago
- Devlog #3: Edge Case World Switching. Español/Spanish version.12 days ago
- Devlog #3: Edge Case World Switching12 days ago
- Devlog #2: La Terminal y su Diseño. Español/Spanish version.12 days ago
- Devlog #2: The Terminal and its Design19 days ago
- Devlog #1: "El Studio Abandonado – Diseñando Eclipse Studios" Español/Spanis...26 days ago
Leave a comment
Log in with itch.io to leave a comment.