Week 5

Week 5 (23/10/2020)


This week I added grabbing and throwing objects to my prototype.


While I was doing this, I decided to add the ability to disable physics on objects, causing them to stay in place. In the context of a game, this would be used as a way of traversing the environment, as it allows to player to manipulate objects to form simple structures such as bridges and stairs. Physics can be re-enabled at any time.


I made the grabbing mechanic by shooting a constant Raycast from the player camera to detect objects:

If the player is in range of the object, Clicking the Left Mouse Button enables a Boolean which makes the object a child of the player camera, and disables all movement, causing the object to move with the object:

The method is based on this tutorial: https://www.youtube.com/watch?v=Xv-c3-IOnM0


Pressing the right mouse button works the same way, but it does the opposite, causing the object to drop. Pressing R still removes the object from the camera, but the movement constrains are still enabled, resulting in the object floating in the air.


I plan to add a way to destroy objects next.


While I am very pleased with what I made so far, I think that the control scheme can be improved, as it uses too many buttons. The current key bindings (PC) are:


Left Mouse Button: Pick up object

Right Mouse Button: Drop object

Middle Mouse Button: Throw object

R: Disable physics

Q: Grow

E: Shrink


I aim to make changes to these controls in the future, to improve the user experience.


In the next few weeks I intend to block out a test level, to get an idea of how well this mechanic would work in an actual game, then continue to refine it.




This site was designed with the
.com
website builder. Create your website today.
Start Now