test #1 (Graphic idea, movement, animation, sound, camera control)


Here is the begining of the game.


I get and idea of the scene, controls and movement i want in the game.

I decided start with the camera control with this specifications.

- Move with the mouse movement.

- Limit the area view (up, down left and right) like a real head.

- if the limits are reached right or left, make the player rotate.

- You can see part of your body, want to looks like you are the robot


Usually in the Standart Assets of unity there is a Prefab for 1st person character, is usefull but for this specifications is better for me to create it.


I use the character and add the camera as a child of the head of the body (this body is rigged)


And start the coding section, this was the code resulted for the camera controler.

With this code you control the rotation of the object with the movement of the mouse, create the limits for each direction so it can be passed and we rotate the character when reach the x limits and the limits are always updating dependig of the eulerrotation of the character.

And this code is placed for the HEAD, i want to give that movement to the head and like before i said, the camera is inside of the head as is its Child so the camera will take the movements.

So we can get this result:


The camera is ready, now is time for the MOVEMENT.

In this case i decided to use the RIGIBODY movement, cause i want the movement depends of the direccion of the player, the player can move in any direccion but the rotation will depends of the camera movement.

is a short code where whe alter the rigibody velocity but it will move depending the direction of the character position, this was added to the character.

And to leave this section clear decided to do the animations needed for this movement

Just need 3 animations (Idle, Walk Forwark, Walk Backward)

To be honest is the first time i really do the animations, but if the character is rigged or comes from Mixamo.com i swear is easy to learn, you can animate only rotating sections.

to get this simple result


And the last thing i did was some sound for the walk section

I like to put the sounds on the ANIMATION so it sound exactly when the pass is done.

and decided to use i little code for the walk

with this i will get a different step each time the code is actived, and you can see in the animation lime of the walk that there are some spaces for an audiosource and for a script, i activated and desactived those to get the footsteps.

And that is, you can download the test for the movement until a create the next update or here you can get this test to see the result

https://www.mediafire.com/file/w422uhz3pvikd0e/Forgotten_0.1_-_Walk%252C_camera%...

Files

Forgotten.zip 29 MB
Jul 07, 2021

Get Forgotten

Leave a comment

Log in with itch.io to leave a comment.