Unity Tutorial How to Pick up and Throw objects 13
>> YOUR LINK HERE: ___ http://youtube.com/watch?v=kb0ZuFDZmaU
How to make multi-player games: http://y2u.be/QfzrpxO89tU • Picking up and throwing objects is a common mechanic in recent games. Here I cover how to do it with some quick scripting that can be modified to your needs. • -- For any question or requests, feel free to comment! • -- http://unity3d.com/unity/download/ -- Download Unity3D here free • • Movement script: • #pragma strict • var moveSpeed = 0.2; • function Start () { • } • function Update () { • Screen.lockCursor = true; • • Screen.lockCursor = false; • • Screen.showCursor = false; • rigidbody.AddForce(5 * Physics.gravity); • if (Input.GetButton ( w )){ • transform.Translate(Vector3.forward * moveSpeed/3); • } • if (Input.GetButton ( a )){ • transform.Translate(Vector3.left * moveSpeed/3); • } • if (Input.GetButton ( s )){ • transform.Translate(Vector3.back * moveSpeed/3); • } • if (Input.GetButton ( d )){ • transform.Translate(Vector3.right * moveSpeed/3); • } • }
#############################
![](http://youtor.org/essay_main.png)