What kind of script could I write to work around this issue? (Jittering character)

Hi guys,

I know there are many threads with the jittering characters on moving objects mentioned but only one thread seemed to have had a solution, but I couldn’t get that solution to work without a ton of build errors (this thread):

http://answers.unity3d.com/questions/8207/charactercontroller-falls-through-or-slips-off-mov.html

Anyway, the controller script I’m using for the player (the capsule) is the default Character Controller with the default Third Person controller script. The box doesn’t have a script, just an attached animation to move it up and down (although the same problem happened when I used transformations to move the cube as well.

Has anyone came up with asolution for this? It appears the script in the linked thread worked for people but I can’t get it working for me :confused:

Attached is a video of the problem. Does anyone have any suggestions? Also my guess as to what causes this problem, since it only seems to happen when going down (although it will happen when going up too if I use transform instead of an animation) is because the forces of the character don’t match that of the platform, but I could be way wrong.

Attached is a video of what is happening.

602092–21391–$ScreenFlow1.mov.zip (350 KB)

Ok this script worked for me:

private var Activated = false;

function OnTriggerEnter (other : Collider) {
if (!Activated){
other.transform.parent = transform;
Activated = true;
Debug.Log(“ACTIVATED”);
}
}

function OnTriggerExit (other : Collider) {
Activated = false;
other.transform.parent = null;
Debug.Log(“NOT ACTIVATED”);
}

But you have to make a small box collider and make the platform a parent of that collider. Mark the collider as a Trigger in the colliders settings, and disable the mesh renderer. Drag the above script onto the trigger and now you should have moving platforms with no jitter.

Oh, and you have to make sure to make the trigger collider large enough that when the platform moves gravity doesn’t cause you to temporarily “miss” it or you will get jitter again.