- Home /
Question by
thepra13 · Jun 04, 2011 at 06:19 PM ·
checkpoint
problems with check point in unity
i trying to make just one chackpoint but i cant this is my character code
var speed = 6.0;
var jumpSpeed = 8.0;
var gravity = 20.0;
private var moveDirection = Vector3.zero;
private var grounded : boolean = false;
function FixedUpdate() {
if (grounded) {
// We are grounded, so recalculate movedirection directly from axes
moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, 0);
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= speed;
if (Input.GetButton ("Jump")) {
moveDirection.y = jumpSpeed;
}
}
// Apply gravity
moveDirection.y -= gravity * Time.deltaTime;
// Move the controller
var controller : CharacterController = GetComponent(CharacterController);
var flags = controller.Move(moveDirection * Time.deltaTime);
grounded = (flags & CollisionFlags.CollidedBelow) != 0;
}
@script RequireComponent(CharacterController)
can someone help me pleese
Comment
What's wrong with my last answer: http://answers.unity3d.com/questions/126080/how-can-i-create-a-check-point-in-unity.html
Your answer

Follow this Question
Related Questions
Checkpoint Scripting Help 1 Answer
How do I create a good Checkpoint system? 0 Answers
Checkpoint GUI enabled then disabled trouble 3 Answers
Reset a scene but save checkpoints. 2 Answers
how do I make smart checkpoints? 1 Answer