top of page

Not a Tracer obstacle course

ROLE

Solo Project

DESCRIPTION

This was a two week assignment for a Visual scripting course I had at Future Games. 

I wanted to push my knowledge of blueprints a bit by trying to replicate the movement of one of my favorite characters (Tracer) from the game Overwatch.

And then built an obstacle course the player can traverse using the unique movement set of this character.

YEAR

2022

GENRE

Obstacle course

PLATFORM

PC

Engine

Unreal 4

Image by Vincentiu Solomon

The Special Abilities

Blink

Rewind

Image by Vincentiu Solomon

The Blink

Thought Process

I started off by making the player able to blink aka teleport in their current forward direction.

This I made by having a line trace go out from the player and forward x-amount. Then take that position, and set the players location to that location. The player would however stop short if the line trace or the player mesh would hit/be blocked by anything before reaching max distance.

Then after more research on how the original ability works. I found that I'd forgotten that if the player is currently moving in a direction, the player would instead blink/teleport in the current movement direction and not the facing direction.

So to fix this I made 2 functions.

One that would take care of the simple blink/teleport in the current facing direction, if standing still or having no movement input.

And one that would take the movement of the player in consideration instead of facing direction

The first one like mentioned earlier is pretty straight forward.  The other one however needed some more work to get it working as intended.

Fort starters I needed to make a new 2D Vector variable where I would store the movement direction the player is currently moving in. (Input Movement Direction)

And to make sure that the calculated distance would be the same even when moving diagnaly I clamp the value to be stored in the movement vector.

After that I used the same math as for the facing direction to get the direction the line trace needed to go, as well as the length/end location.

The only difference being that I had to make the calculation twice, one for the X-direction and one for the Y-direction before combinding all the values.

Image by Vincentiu Solomon

The Rewind

Thought Process

First, I needed to save the players transform in an array so I later could reference them for the rewind.

So I started off with getting the transform of the player every 0.01 seconds. and then add it to an array.

Why every 0.01 seconds? Because it's easy to tweak if it is sorted in 100's. For example, if I want to save 3 seconds back in time, I know the length of the array would be 300. And if I wanted maybe 2.5 seconds, I would just have to change the max length of the array to 250.  And having this many transforms saved, makes the rewind look nice and smooth, as well as stop the player from moving through walls and other static meshes.

When the player performs the rewind,  we go through the whole array. Using a timeline to move between each and every transform saved until the array is completly empty, and we have reached the end destination.

1. Check if the array is empty

2. If not we move from current transform, to the next valid index transform

3. When the timeline is finnished. We removed the used index, and start over again. 
This continues until the array is completly empty.

4. As the last step, we make another timeline to smooth the reset of the player mesh pivot.

The reason we need to do this, is because we save the controllers pivot when saving rewind transforms.
This is because normally the pivot of the player mesh never change when just looking around with the mouse. It is only the controller's pitch that change. 

We do want the player to look in the same direction as it was in that point in time we are going back to, including the pitch. But we also have to make sure that the player is standing up right again, as the mesh pitch should never change. (We do want the feet to be on the ground after all).

bottom of page