Skip to content

Instantly share code, notes, and snippets.

@OutlawGameTools
Created March 9, 2015 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OutlawGameTools/f3bb2e2f2d0cd3e7dae4 to your computer and use it in GitHub Desktop.
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)
#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