Hi guys, I'm trying to make a platform move when the player stands on it, the platform have a rigidbody attached (that I've set kinematic) and the player have a collider and a character controller. I call the function OnCollisionEnter from the platform, but seems that it doesn't work, what could it be? and what's the best way to implement this? thanks
edit: i've noticed that it works fine when I make the platform collide with another rigidbody, but shouldn't it works fine with the character controller?
function OnCollisionEnter(coll : Collision) {
if(coll.gameObject.tag == "Player" && ontrigger){
Debug.Log("urtato");
}
}
@script RequireComponent(Rigidbody) //richiede rigidbody
I think the problem is that this object is kinematic and the player isn't a rigidbody, but a character controller, so any ideas about how should I make this thing?
but I need it to be kinematic, or the platform will fall down, I need it to stay there and move only if it collide with the player, what should I do? If i use a trigger then the player will fall trough it
– sonic220and I've just tried to make it not kinematic, but the collision doesn't work neither
– sonic220no the collider isn't set to trigger
– sonic220Could you put some of your script into your post?
– anon45606706done, there isn't much
– sonic220