Monday, March 21, 2022

Final Major Project - Animating a Door (Blueprints)

Learning how to make objects interactive..

    Before this project, I had never animated or made anything interactive using the Blueprints section in Unreal Engine. So at first, I felt a little intimidated because I didn't quite know where to start - however, one of my course mates helped me out a great deal by explaining to me what most things mean and do in the Blueprints layout in UE4. So that's where I started.

    I had already modeled the door, although in order to make only the door open and close and not the entire door frame, I had to go back to 3Ds Max and separate the objects. Then, I imported everything in Unreal Engine once again, opened Blueprints and used a little default cube to put in the bottom right corner of the door in order to indicate exactly where the opening and closing of the asset is going to be. 




    The ''E'' is just a little something that I attempted to do.. I wanted to also try making it appear on the screen once the player goes close to the door so that they would know what button to press in order to interact with it. Below, I'm going to explain how this plan failed and what alternative way I found to make this clear. 


Blueprints 




Duration




    In order to make the player be able to interact with the door only when they're close enough to it, I create a little box that surrounds the area around the asset. This way, the player will be able to close and open it only once they go inside of that box. It's invisible when the game is in normal play mode, but it's visible when you go back to the default mode in order to continue building and editing your level. This way it can be changed manually, if needed. 


Blueprint Graph






    In the Blueprints, what we do is create the actual event that's going to play out in the game. First of all, I set up a button of my choice (it can be any, in my case I simply chose E) that upon being pressed would make the interaction happen. Second, I set up the little box that I had put in the bottom right corner of the door as an Action Location, which indicates where the animation would work from. And lastly, I added a Control Rotation because I figured that's what's going to make it open by rotation, therefore in the correct way I want it - towards the player. 

  
Press "E" to interact




  The problem that I had was making this text, Press "E" to interact, appear and disappear also only when the player was inside of that box and close to the door. However, no matter how I tried to do it, I couldn't get it actually appear and disappear - it would either be there consistently or not appear at all. So in the end, I ended up deciding to use a default text in Unreal Engine to just indicate to the viewer that they can continue further in the environment and enter the next area by pressing that button. 

    Learning how to make that one particular thing work in future projects is currently one of my stretch goals because I think it would look quite nice and add a lot to the overall immersion of any game. I've really been enjoying learning about Tech Art a lot his year. It used to intimidate me in the past, but now I've realised just how many cool things there are that I can do with it. 


The Attempt




:(

No comments:

Post a Comment

Final Major Project - Beauty Shots

  Final Major Project  Beauty Shots      In a way, it's so very strange to me that this is going to be my final hand in. I have spent so...