Created
March 9, 2015 09:21
-
-
Save OutlawGameTools/f3bb2e2f2d0cd3e7dae4 to your computer and use it in GitHub Desktop.
CS109 - Move a game object using Rigidbody2D.AddForce. (Phase 1 of this script)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma strict | |
public var speed : int; | |
function Start () | |
{ | |
var newSpeed : Vector2; | |
newSpeed.x = speed; | |
newSpeed.y = 0; | |
GetComponent.<Rigidbody2D>().AddForce(newSpeed); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment