Building a Game with Unity3D
changes to example script var myrigidbody:Rigidbody; // declare a variable of proper type myrigidbody=GetComponent(Rigidbody); myrigidbody.AddRelativeTorque …
+make a game with unity +brackeys Unity Basics make a game - 1 make a game - 2 Make a game- 3 make a game - 3b - camera Make a game - 5 - shadows + respawn make a game - 5a - jumping make a game - 6 - quality settings make a game - 7 – collectibles make a game - 8 - animation many more videos: use the search in the title above
moving a sphere function Start () { // saved for posterity queriesHitTriggers=true; blue_rotation = Input.GetAxis ("Horizontal") * rotationSpeed * -1 ; blue_rotation*=Time.deltaTime; rgdblue= GetComponent (Rigidbody); rgdblue.velocity = new Vector3 (.1*rotationSpeed * Time.deltaTime, 0) ; rgdblue.velocity=rgdblue.velocity*-1; rgdblue.AddRelativeTorque (Vector3.forward * blue_rotation); //vector3 is 3D mgmt } function Update() { blue_rotation = Mathf.Abs(Input.GetAxis ("Horizontal") * rotationSpeed ) *-1; blue_rotation*=Time.deltaTime; rgdblue=GetComponent(Rigidbody); rgdblue.AddRelativeTorque (Vector3.forward * blue_rotation); //vector3 is 3D mgmt }