Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var speedY : float;
- var speedZ : float;
- function Update(){
- if(Input.GetKey("d")){
- GetComponent.<Rigidbody>().AddForce(Vector3(speedY,0,0));
- }
- if(Input.GetKey("a")){
- GetComponent.<Rigidbody>().AddForce(Vector3(-speedY,0,0));
- }
- }
- function OnCollisionStay(col : Collision){
- if(Input.GetKeyDown("w")){
- GetComponent.<Rigidbody>().AddForce(Vector3(0,speedZ,0));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment