top of page

Expanding on BITS of Unreal

  • Rhys Sellars
  • Jun 18, 2016
  • 2 min read

This week saw the class beginning to delve further into the functions and abilities of Unreal and introduced more new sections of visual scripting. We began working on the foundations of our 'Endless Runner' assignment. We began working on correcting the player controlled character's controls so that he would constantly run forward without player input, as well as added functionality for turning corners when on specific tiles or segments. This was achieved by creating custom functions that we can then call to do something in another section of the script. We created a custom 'Turn Corner' function that used branches or 'if' statement to ask if the player could turn a corner. If they could, the player would be able to use A or D key input to turn, if not, this input would do nothing and the player would just strafe left and right as normal.

This lesson involved further use of creating variables and how to use Getters and Setters. An example of the use of this was finding and setting the rotation direction for our player character. We created a 'Desired Rotation' variable which would store data when it is called. In this case we had to 'Get' the direction of rotation and by how much, in this instance it was +/-90 degrees, which is then stored in the 'Desired Rotation' variable and 'Set' to perform the turn of that amount when the appropriate key is pressed. The consistent running was achieved through use of a 'Tick' event, which is called every frame and pushes the player in the forward direction.

An issue occurred when the player would turn a corner where the player would change they position in a single frame. To correct this we used a LERP or Linear Interpolation which makes a smooth transition as the character rotates. This was still too quick and the concept of Delta Time reared it's ugly head again. To the uninitiated, Delta is the time between each frame. This can be manipulated through 'Time Dilation' where Delta Time is converted into seconds. This conversion is what creates the 'smoothing' or natural turn effect.

We also expanded on the implementation and addition of objects in the Viewport of a Blueprint Class. In this case we were creating a floor tile that constantly spawns 10 instances at any given time. This was an interesting experience for me as my computer thought it would be wise and froze during the lab exercise. Interestingly enough this actually corrupted the objects in my Viewport which ultimately affected how they spawned in the engine. My script was fine, and the work around was having to recreate the entire floor object from scratch. This in itself was also a valuable point as I had made an error where I incorrectly positioned the floor's 'spawn point' which then further created issues with Z-axis fighting with each instance of the floor tile. It was a tiresome headache, but ultimately overcome. Despite being an annoyance, it was one of those valuable events that actually helps one look for certain issues to help bug-check errors.

Until next time, stay safe and game well.

Comentarios


 THE BIT BLOCK: 

 

Welcome all to The BIT!

Together we will walk down the uncertain path of being a Game Developer, and the journey of attaining the knowledge to succeed.

 RECENT POSTS: 
 SEARCH BY TAGS: 

© 2016 - 2017  by Rhys Sellars. Proudly created with Wix.com

  • LinkedIn Social Icon
  • Twitter B&W
  • YouTube Social  Icon
bottom of page