Skip to main content

On-Rails Shooter Project - Week #3 - Rotating The Players View

 

Now that the player will successfully travel from point to point within the level and will no longer skip any steps before reaching the end, I now need to rotate the player camera since presently if I make the "Simple Move to Location" node move the players location left or right the player camera does not turn to match this and the player just watches as their character is forcefully pushed to the side while they start at a wall. This isn't good sine if the enemy character was to attack the player during this movement the player would not see the attack animation or have chance to respond and shoot at the enemy character as they don't have any control over the player characters movement or orientation, instead I the developer has that control. 

As with making the player character move from Target Point #2 to Target Point #3 I could just use the "Set Actor Rotation" node to snap the player viewpoint from what it was to the new direction where I wish their attention to be, however, just like the "Set Actor Location" node this is far too sudden for the player to have an enjoyable experience but unlike that previous solution for player movement there isn't an alternative node such as "Simple Rotate" that I can plug the new direction rotation into and have it smoothly transition between the two rotational values. The change this sudden snap from Rotation #1 to Rotation #2 and make it smooth I need to create a string of code where the engine will find the differences between the two rotational data points then linearly adjust between them. For this linear transition I am going to use a "Timeline" which is a function of Unreal Engine that will allow variables to change over a set period of time.

To start with timelines you need to create a "add Timeline" node then open it up (double click) and create a new "Track" in relation to the variable type you are changing (float or vector or event), which in my case here is a float track as that will give me the linear difference I am searching for between the two rotational data points I have. The job isn't finished yet, inside the float track I created two Key frames which store information at two points of the track (Start and End) and then told the engine to make a curve joining these two points so that the transition between frames is exponential. The secondary key frame will decide how long this transition between rotation #1 and rotation #2 (must be less then or equal to the "Track Length" value) and the number entered into key frame #2's "Value" section will decide the number of degrees that the rotational data is increased by. One final step is once the rotation is done and the timeline track has ended the timeline node will reset the player camera's rotation to the 1st key frame but will not continue onto the other key frames, this is a nuisance for me as I was using the timeline to edit a variable that I wish to keep the changes of and so the fix is to set the control rotation this time as the newest changed version of the rotation variable but once the track has end so this will be plugged into the the "Finished" pin of the Timeline's node in the Event Graph.

Comments

Popular posts from this blog

Guest Lecture #1 - 21/09/2022 - Secret Mode

Guest - Joshua Garrity, Head Game Scout at Secret Mode Guest Bio Joshua started as a product Manager in the marketing department. Joshua was in charge of digital publishing for Fireshine. Attending public events like Gamescom not only allowed him to network his way into the position as Head Scout at Secret Mode but is also a method he uses to accomplish his job by seeing new indie projects in beta stages at these events. Takeaway #1 – How to Pitch my projects Scouts and Studio CEOs will be travelling often and walking around both Hotels and event centers, so  you  need to be able to pitch your project anywhere at any time. This means your presentation needs to be smooth, quick, and confident, when talking with scouts, CEO, or other representatives you need to answer their questions (without checking notes) and speak honestly about what your team has done and what it will cost for your studio team to do more. Takeaway #2 – What Do Game Scouts Get Up to Game Scouts in their day-...

Guest Lecture #4 - 19/10/2022 - 10:10 Games

  1st Guest Bio - Bart Kosciolek, Junior Animator @ 10:10 Games Jfjdiejdjd 2nd Guest Bio - Reece Hewitson, Junior Games Developer @ 10:10 Games skdjalskjdlkasjd Takeaway #1 - Determination As an applicant trying to get into the industry I will be rejected many times due not being the correct fit for studios I am applying for, be it not enough experience or not the correct style of work for how the studio does things. I need to not let this deter me.  Takeaway #2 - Networking The video games industry is still very young (in business terms/years) and still very small (in one sense), while a single title is a product of many peoples work all put together those people often split after projects have been finished and they will end up working on other projects at other studios and this results in "everyone knows everybody" where you can say a name in conversation with a new co-worker and they'll reply with "oh yeah I know (name) I've worked with them on this project. ...

Guest Lecture #2 - 05/10/2022 - Rebellion Games

  Guest - Peter Dimitrov, Environment Artist @ Rebellion Games Guest Bio Peter enlightened us and told us his day-to-day while he worked on the 1st DLC project for Sniper Elite 5, as a environment artist Peter worked with another level designer to develop and refine the flooded map level that the 2 of them had been assigned to.  Takeaway #1 - Working with limitations      Both Peter and his co-worker had to stick to a schedule where sections of the map needed to be                   done to a specific deadline, the white box version needed to be done within a certain time limit,                   changes could not be made once the art pass had started, the map needed to include certain features like      ditches and a spot for a supply train to run through. The map itself went under many changes before         ...