Skip to content

Instantly share code, notes, and snippets.

@touyou
Created February 27, 2014 08:18
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 touyou/9246328 to your computer and use it in GitHub Desktop.
Save touyou/9246328 to your computer and use it in GitHub Desktop.
import UnityEngine
class BallController(MonoBehaviour):
public Speed as single = 20.0f
def Start():
rigidbody.AddForce((transform.forward+transform.right) * Speed, ForceMode.VelocityChange)
def Update():
pass
import UnityEngine
class RacketController (MonoBehaviour):
public Accel as single = 1000.0f
def Start ():
pass
def Update ():
rigidbody.AddForce(transform.right*Input.GetAxisRaw("Horizontal")*Accel,ForceMode.Impulse)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment