Hello,
i have a little problem. I making slender game in space and i want vertical moving. And i have 2 problems.
- I cant move down (its working in first few clicks and then player quckly start moving up and u cant stop this moving)
- Moving is like jumping from one to one its not smooth move
CODE:
#pragma strict
var boostFactor : float = 100; // or whatever
//var GameObject Target;
function Start () {
}
function Update () {
if ( Input.GetButtonDown("Fire1") ) {
gameObject.rigidbody.velocity += gameObject.transform.up * boostFactor;
}
if ( Input.GetButtonDown("Fire2") ) {
gameObject.rigidbody.velocity -= gameObject.transform.up * boostFactor;
}
}