- Home /
Dragging Planes doesn't work with iOs?
Hello community
I have series of planes facing my FPS Camera
when I click and drag the plane away the FPS Camera Lerps forward and I am faced with the next which I drag away etc...
My script (below) works in unity, but Not in iOs... The Loading Screen freezes (& I only have a few photo textures on a few planes)
Any ideas?
Thanks!
be
var myFPS: Transform;
var camPos: Vector3;
var endPos: Vector3;
var time : float;
var someBoolean : boolean = false;
var dragBoolean : boolean = false;
var drag: float = 0.01; // drag factor
function Start () {
}
function Update () { // FOR CAMERA
// Debug.Log ("nope");
if(someBoolean == true) {
myFPS.transform.position.z = Mathf.Lerp(camera.main.transform.position.z, endPos.z, .5f * Time.deltaTime);
//Debug.Log ("true");
}
}
function FixedUpdate(){// FOR DRAG
var vel = rigidbody.velocity;
rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ;
vel.x *= 2.0-drag; // reduce x component...
vel.y *= .0-drag; // and z component each cycle
vel.z *= .0-drag;
rigidbody.velocity = vel;
}
function OnMouseUp () {
dragBoolean = true;
// Debug.Log ("Drag");
someBoolean = true;
// Debug.Log ("Move");
yield WaitForSeconds(1);
someBoolean = false;
}
Comment
Your answer
Follow this Question
Related Questions
Character Slowly sliding off platform 1 Answer
A position locked hinge joint with drag and no gravity? 1 Answer
Rigidbody loses speed 1 Answer
Objects with colliders going through walls and each other. 3 Answers
adding drag to a relative force 0 Answers