Hey, having a little trouble with my game. Basically, I have a moving platform inside my game that moves from left to right on a loop. The player can jump on the platform but as soon as they hit the platform, they slide off (do not stick to it). I have tried doing this with OnCollisionEnter and OnTriggerEnter but it doesn’t seem to work.
I know this has been asked before but I cannot relate to any of the answers. Can anyone point me in the right direction? I attach this code to the moving platform :
function OnTriggerEnter (other : Collider) {
if(other.gameObject.tag == "Player") {
other.transform.parent = transform;
}
}
function OnTriggerExit (other : Collider) {
if(other.gameObject.tag == "Player") {
other.transform.parent = null;
}
}
Player tag = Player ||
Platform tag = Platform.
If you need anymore information, I will be here for a while so feel free to ask. I hope you guys can help