Mirrored from my blog (en, pt-br
On day 22 I did the GODD of the SinC, the CustomPlayer, and the gun shoot.
The first thing I did today was the GOD of Sync (Shooting Into Cubes [name that thought for now]). I will not explain how the GOD is, it is easier to see:1. Executive
1.1. Game Type
The game will be a first person shooter puzzle.
1.2. Name2. Game Elements
The name of the game will be for now SinC (Shooting Into Cubes).
The goal of the game is shooting into cubes in order to take them to certain areas. To do so the player will have a weapon capable of:
- Change the projectile velocity.
- Change the projectile mass.
- Change the projectile impact.
- Remove gravitational force of the cubes.
- Remove forces of the cubes.Invert gravitational force of the cubes.
In addition to this weapon the player will also have the ability to stop time to prepare and plot the best strategy. While stopped in time the player can shoot projectiles, which also froze and returned to their trajectory when the time flow is restored.
2.2. Game Pacing
As the mechanics of the game will be very repetitive the game will aim to be casual, where the player doesn’t need to follow stories and other elements.
2.3. Target Audience3. Story Elements
The game will target audience of players who enjoy first person shooter and puzzle without age restrictions, because the game doesn’t contain any violence or situations that may cause discrimination.
3.3. Player role4. Interface
First Person Shooter.
Basically the game will feature a main menu and one where the player will be able to choose the level you wish to play.
- Player’s movement.
- W – Forward.
- S – Back.
- A – Left.
- D – Right.
- Camera’s movement.
- Change projectile velocity.
- Change projectile mass.
- Mouse scroll when Ctrl pressed.
- Change the impact type.
- Mouse scroll when the right mouse button pressed.
- 1, 2, 3 of the keyboard.
- Time toggle.
PDF version: Download
Where I found (it has more models): Access
After that I found here on the notebook, the prefab of a first person controller that I had made following a tutorial
of FPS (I call CustomPlayer). He has the camera movement much smoother than the Character Controller that comes by default in Unity, actually I haven’t looked too in the settings to see if it can achieve the same result.
In the videos below you can see the difference.
See for yourself:
The tutorial is very good, the author explains each line of code. Start watching here
As CustomPlayer was ready I just needed to integrate with the gun. At this point I found a problem actually is the difference of coordinates between Unity and Blender (in Unity Y is up and Z in Blender is up). As the script places the gun in the direction of the camera (the player’s eyes) and the coordinates are different, the gun stood aside. One way to solve this would be to change the script, but it would be very complicated, because I would have to keep the coordinates swapped. I researched and resolved in a way that is in Unity’s own documentation (here
), place the object inside an empty object (Like the empty object is created within Unity the coordinates are equal), then any manipulation should be done through this empty object .
After I fixed the position of the gun, making the shooting script was pretty easy at the moment it is only changing the projectile speed.
http://www.youtube.com/watch?v=eRFH9GbyDZw&feature=player_embeddedTest here.PS: Sorry for the bad english.