Hey guys,
I have some problems for the game that I am trying to make. My character is a ball and I wondering how I can act something like, if the ball goes to a specifiek object like jump object or speed boost…how can I add extra force on that ball object.
Since on OnTriggerEnter() or OnCollisionEnter() is not possible to use the AddForce command…so anyone have idea how else I can make this work?
Here is my code for the ball character:
function OnTriggerEnter(other : Collider) {
//if deadzone is been entered
if(other.tag == "DeadZone")
{
}
if(other.tag == "Finish")
{
//play the sound
other.audio.Play();
//yield WaitForSeconds(1);
Application.LoadLevel(nextLevel);
//Show other level
Destroy(other.gameObject);
//if the ring is hit load a new game
//Application.LoadLevel(nextLevel);
//if there is no level destory the object
Destroy(gameObject);
}
if(other.tag =="Crystal")
{
other.audio.Play();
yield WaitForSeconds(0.4);
Destroy(other.gameObject);
}
if(other.tag =="PowerSpeed")
{
//Should give the object extra movement
}
}
Any suggestions or ideas how I can able to make this work is welcome.