Devlog 1: The Rotation Sensation


Hello! 

One of the core mechanics in Lockdown, is the ability to pick up, move, and inspect objects in order to solve problems. 

I'm going to show you what I did in UE5.1 for this mechanic.

When the player presses left click, a line trace is shot out(a line trace is basically a raycast in unity).


If the Line hits a physics object, a physics handler is used to allow the player to pick up and move with objects freely until the left mouse button is released

I use an event tick to check if the object is being held, and updating it to follow the players position


Isn't that neat!

In order to rotate and zoom in objects, I first needed a separate blueprint so it can be easier for future me to add properties to objects.  I made the blueprint have an empty static mesh with a sphere collision around it. The mesh is empty so you can easily replace what model you want to use in game.

I go back into the player blueprint and create another invisible static mesh component.  I then have an event if the player presses Q while already picking up an object, the object will appear closer to the screen, changing the second static mesh to the item that is being held, and disabling movement.


I have the mouse x and Y axis affect the rotation while in this stage using a rotator, affecting the roll and pitch.

Zooming in and out uses the scroll wheel, and, with a branch(if statement) to see if the item is already zoomed out, if it is, you can zoom in! I have this in so you don't get motion sickness since the animation repeats violently.  I use a timeline so the zoom doesn't teleport the object to your face, instead actually giving it a zoom effect.




Isn't that neat?

(sorry itch.io only lets me upload 3mb files or lower)

Well the first mechanic is done, I cant wait to show you the others we have in store for you! 

Until next time!

~Steven

Get Lockdown

Leave a comment

Log in with itch.io to leave a comment.