I want to have a player move with a platform whenever the player is on it. I have this script which works when the player jumps on the platform but not when he leaves.
My script is below. I don’t know why is isn’t working as it works with booleans but just not transforms!
var platform : Transform;
var player : Transform;
function OnTriggerEnter()
{
if(player.tag == "Player1")
{
player.transform.parent = platform.transform;
}
}
function OnTriggerExit()
{
if(player.tag == "Player1")
{
player.transform.parent = null;
}
}
I want to increase this to four players but it doesn’t even work for one… Any help would be great.
Cheers, Peter