Unity 3: Character Controller and Platforms

I’m using Unity 3 Pro and the character controller is falling though platforms. I seem to recall something about the character controller being updated to handle platforms. Is that correct?

I’m using free U3 and was wondering when someone would mention the problems with the platform support. First off is there any difference between the pro platform support and free? At least it doesn’t mention anything in the licenses comparisons about it. I did get it to work after fiddling with it for a while. Trying all the different options for movement transfer i then realized that i needed Platform Input controller script with it. But it still had problems with side to side movement. The funny thing is, as looking at the code, its so complex for something so simple. So i’m hoping someone can explain why it needed to be so many lines to have platform support. Witch i don’t get any way cause i have a script with six small lines that works with both side to side up and down and circular motion.:slight_smile:

How did you get it work? What is the Platform Input controller? Is that an included script?

Yeah they updated the character controller system from Unity 2.6 to 3. All other players prefabs I had failed once I upgraded to Unity3 … they all fall through everything. I fixed this by removing the previous character controller and using the one provided with Unity3. The Uniy3 character controller is based on a newer character motor script, so if you see that you should be good.

All I can think of is checking to see if the IsTrigger is ticked or not :slight_smile:

If there is a real issue with something not being converted properly from 2.6 to 3, I’d recommend you bug it and get in contact. I’m a freebie user but got excellent support from the unity folks :slight_smile:

Yes the Platform Input controller is a separate script(standard assets U3 || boot camp demo), and i cant say if its needed or not, but its the only way i could get the platform support to work. It references the character motor a couple of times so i figured it was needed. The way this platform script is beyond my script skills so i didn’t understand it very well. It just looked way to complex for a platform rider script. Unless it has some super powers that i don’t know about_lol. But as stated above i don’t thing its the character controller but the substitute for the walker script that holds all the cards for the platform support. I was hoping that it would just be a built in engine feature. Anyway on a personal note, I though the boot camp demo was very well done but i didn’t like the way all the scripts were to reliant on other scripts to work.
And i’m even sure what the FPS Input controller script is for_lol. Its like taking the walker script and making it more complex than it need to be and separate it into four scripts that could of been combined. Any how if anyone needs the basic platform script that uses the trigger and parent method here it is.

var platform : Transform;
var player : Transform;

//==============================================//
function OnTriggerEnter () {
    if(player) {
	var GO = platform;
	var GO1 = player;
	GO1.transform.parent = GO.transform;
    }
}
//==============================================//
function OnTriggerExit () {
    if(player) {
	var GO = platform;
	var GO1 = player;
	GO1.transform.parent = null;
    }
}

Setup : (1)Mesh with box collider and animation or mover script.
(2) Child empty object with box collider set to trigger.(script goes there).
(3) Adjust the trigger above the mesh so that there is no jitter(little trial and error)

I saw this script on a Utube vid from a recent topic so if anyone has any trouble ill try to post the link.:slight_smile:

As for as I know, I’ve followed those same steps. I’m using it on a platform that animates vertically, but the player still falls through.
Haven’t found a solution for the issue quite yet.

1- I’ve animated the platform
2- Set an empty object, and checked - is trigger on the box collider
3- The script above ^ is added to the trigger, and the script is set onto the player and the platform being used.
4- the trigger is placed right above the platform.

Is there something i’m missing?

Moving colliders should have rigidbodies - do both platform and trigger have rigidbodies?

I recently tried using rigidbodies on both the platform and trigger, but its causing my player to jitter on the entire environment.

Wel you dont need a rigidbody on the trigger Or the platform. Cause its useing animation. You may need one on the platfrom if your useing scripting to move it though. Do you have a box collider on the platform?

Here is the link to the vid http://www.youtube.com/watch?v=K5ObDagGZjI




Yeh, I have a box collider on the platform.