help I've been making my controller fly with a rigid body so I decided to switch to a character controller. What I've came up with is a rigidbody that flies by jumping repeatedly that was with the rigidbody but now with the character controller I can't produce the same results. When I came close to doing so it just transported me up a certain amount of places. So I tried to just have a button that will just let me go up as I hold it down. Now that is not working here's everything having to do with the flying part of the script:
var upspeed = 6.0;
var upward = transform.TransformDirection(Vector3.up);
var UpSpeed = upspeed * Input.GetButtonDown ("Jump");
controller.SimpleMove(upward * UpSpeed);
**oh and the script for the rigidbody version of the script**
var bulletPrefab:Transform;
var flamePrefab:Transform;
function Update ()
{
if(Input.GetAxis("Vertical"))
rigidbody.velocity = transform.forward * 10;
if(Input.GetButtonUp("Jump"))
rigidbody.velocity = transform.up * 12;
}
↧