I have a boost platform and Im trying to make it so that when the player collides with trigger, AddForce() is applied to the direction of the Z axis of the boost platform. This way i can change rotation during gameplay and the AddForce() direction changes too.
Here’s my code but for some reason the force doesn’t apply. I get no error but i think its the argument for force, but i dont know how to fix it.
#pragma strict
function OnTriggerEnter(collision : Collider)
{
if(collision.gameObject.tag == "Player")//Ball Collide Speed
{
Debug.Log(transform.forward);
collision.gameObject.rigidbody.AddForce(transform.forward * 100);
}
}