Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The most simple tutorial:
- Create a new project
- Save the scene as "Main" in the Assets Directory
- Create a cube, Rename is "Player"
- Reset the "Player" transform
- Change the "Player" transform.scale.z to 2
- Create 2 scripts: Mover, Shooter, Open them for editing
- Look up "Input.GetAxis" in the docs
- Copy the contents of the "Update" function into the "Update" in your "Mover" script
- Look up "Input.GetButton" in the docs
- Copy the contents of the "Update" function into the "Update" in your "Shooter" script
- Create a new sphere, Rename it "Shot"
- Change the "Shot" transform.scale to (0.5, 0.5, 0.5
- Drag the Sphere into the project view
- Delete the Sphere from the scene (this makes a prefab of the Sphere)
- Drag the Sphere Prefab into the "Projectile" slot on the "Player"s "Mover" script
- Save
- Play
- Hold down the Arrow Keys or WASD keys to move, and the Left Mouse button to leave spheres behind
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement