hello,
Im making a horizontal controlling game,
I got a little problem here.
I tried to lock the character’s z position like this:
public var lockX : boolean;
public var lockY : boolean;
public var lockZ : boolean;
private var startPosition : Vector3;
function Start() {
startPosition = transform.position;
}
function Update () {
var position = transform.position;
if(lockX position.x != startPosition.x)
transform.position.x = startPosition.x;
if(lockY position.y != startPosition.y)
transform.position.y = startPosition.y;
if(lockZ position.z != startPosition.z)
transform.position.z = startPosition.z;
}
but this way is really bad, ate about 20 fps number…
What is the best way to lock a transform’s z position but not using rigidbody?
The other question,
I need to make my character’s body “free” when dead but still using joints (sorry, I dont know how to express it better)
just like UDK 's dead characters,
Is that possible?
![]()