moving platform up and down

Hi,

i am controlling my character with the character controller. I can jump on platforms which are going from right to left. But there are problems with platforms which are moving up and down. Sometimes the character fall through the platform. Is there are good solution for this? (i searched 2 hours in the forum and every possible solution doesnt work)

set the platform to be a collider…
then when you detect that you are colliding with the character… just move the character’s position up by the same ammount you are moving the platform by.
make sure you are checking both collision impact and collision stay events.

I have similar thing working on moving and rotating platforms also… but gets a fair bit more tricky with rotating platforms.

You can also try increasing the rate at which the game calculates things… how many steps per second.
edit->projectSettings->time->fixed timestep

try making this smaller… maybe half it…
But the smaller you go, the bigger performance hit you get.

Best to implement the above suggestion first before messing with the timestep

im using the PlatformerController Script from 2d Tutorial:

if (activePlatform != null) {
		var newGlobalPlatformPoint = activePlatform.TransformPoint(activeLocalPlatformPoint);
		var moveDistance = (newGlobalPlatformPoint - activeGlobalPlatformPoint);
		transform.position = transform.position + moveDistance;
		lastPlatformVelocity = (newGlobalPlatformPoint - activeGlobalPlatformPoint) / Time.deltaTime;
	} else {
		lastPlatformVelocity = Vector3.zero;	
	}
	
	activePlatform = null;   <---- MAKE NO SENSE

.....
if (activePlatform != null) {
		activeGlobalPlatformPoint = transform.position;
		activeLocalPlatformPoint = activePlatform.InverseTransformPoint (transform.position);
	}

i went tgrough the script and the line where activePlatform will be setted to null make no sense.Because later in the update method you will make a request if activeplatform is not null. So if you set it before to null it will never go in that if clause. CAn somebody help out?