Okay so I found out that this is a recurring problem among many devs and I also found some alt solutions that might help some being free and some involving money... So the problem is the
rigidBodyfree!
Turn on kinematic when player lands on the platform! No more moving side to side but you can't move the player either unless unlocked.
--
Turn this into playmaker.
// Moving platform support
private var activePlatform : Transform;
private var activeLocalPlatformPoint : Vector3;
private var activeGlobalPlatformPoint : Vector3;
private var lastPlatformVelocity : Vector3;
// If you want to support moving platform rotation as well:
private var activeLocalPlatformRotation : Quaternion;
private var activeGlobalPlatformRotation : Quaternion;
function Update () {
// Perform gravity and jumping calculations here
...
// Moving platform support
if (activePlatform != null) {
var newGlobalPlatformPoint = activePlatform.TransformPoint(activeLocalPlatformPoint);
var moveDistance = (newGlobalPlatformPoint - activeGlobalPlatformPoint);
if (moveDistance != Vector3.zero)
controller.Move(moveDistance);
lastPlatformVelocity = (newGlobalPlatformPoint - activeGlobalPlatformPoint) / Time.deltaTime;
// If you want to support moving platform rotation as well:
var newGlobalPlatformRotation = activePlatform.rotation * activeLocalPlatformRotation;
var rotationDiff = newGlobalPlatformRotation * Quaternion.Inverse(activeGlobalPlatformRotation);
// Prevent rotation of the local up vector
rotationDiff = Quaternion.FromToRotation(rotationDiff * transform.up, transform.up) * rotationDiff;
transform.rotation = rotationDiff * transform.rotation;
}
else {
lastPlatformVelocity = Vector3.zero;
}
activePlatform = null;
// Actual movement logic here
...
collisionFlags = myCharacterController.Move (calculatedMovement);
...
// Moving platforms support
if (activePlatform != null) {
activeGlobalPlatformPoint = transform.position;
activeLocalPlatformPoint = activePlatform.InverseTransformPoint (transform.position);
// If you want to support moving platform rotation as well:
activeGlobalPlatformRotation = transform.rotation;
activeLocalPlatformRotation = Quaternion.Inverse(activePlatform.rotation) * transform.rotation;
}
}
function OnControllerColliderHit (hit : ControllerColliderHit) {
// Make sure we are really standing on a straight platform
// Not on the underside of one and not falling down from it either!
if (hit.moveDirection.y < -0.9 && hit.normal.y > 0.5) {
activePlatform = hit.collider.transform;
}
}
This is based on the 2d Platformer and has rotations and all. here is the link for full details.
http://answers.unity3d.com/questions/8207/charactercontroller-falls-through-or-slips-off-mov.html---
Leave it as is and increase the platformer speed. I found another tutorial on this forums that does it this way as well.
Paid!
Soooo the reason I didn't run into this problem on my platformer was because I was using this asset.
http://forum.unity3d.com/threads/173640-Released-2D-Platform-ControllerThe asset has its own built in gravity system which means no rigidbodies.
Or maybe someone on here has found another solution which would be amazing if shared