Making an Interactable Door in VR


Tutorial followed:


The first step I took for making my door was creating a blueprint class actor and naming it 'door'. I then added a component- static mesh, and grabbed the premade asset called 'door'. This spawned in the asset. Next, I added a second static mesh and named it 'pivot'. I implemented a cube for it, and detached it from the door. The cube was far too large, so I scaled it down much smaller and moved it to the left bottom corner of the door. I attached the static mesh door to the pivot as well. I rotated the pivot along the Z axis which moved the door too, showing everything was working up to this point.

I moved onto the event graph section and connected the event beginplay node to the timeline node 'play from start'. Here's where things get more complicated- I double clicked on the timeline and brought up a new viewport to work in. I added a float track and changed the length to '1'. This would be how long it takes for the animation of opening and closing the door. The next part is important- I added 2 keyframes, one at '0' (the beginning of the animation) and one at 1, the ending of the animation. 

The value of the keyframe at '0' was left at 0, but the second keyframe's value at 1 was changed to -90. This is how the animation of the door opening and closing works. I made sure to click compile, as the final part of the timeline.

Moving back to the event graph, I dragged the component 'pivot' onto the graph and connected it to 'target' on a node called 'setrelativerotation'. I right clicked the new rotation section on the afformentioned node to split struct pin, allowing me access to the rotation of the 'z' axis. I dragged the timeline's new track 0 to the new rotation Z (yaw). Before going back to the viewport to test the simulation, I made sure to hit compile.

Leave a comment

Log in with itch.io to leave a comment.