Hello guys i am in need of your help yet again :).
Here is my problem:
I have an axe and a tree. The player which is an FPC controller first picks up the axe(and thus the axe becomes the child of FPC in the heirarchy) and it works just fine. the code is as follows:
static var axeOn : boolean = false;
function OnControllerColliderHit (hit : ControllerColliderHit)
{
if(hit.gameObject.tag == "tree")
{
}
if(hit.gameObject.tag == "axe")
{
if(axeOn == false)
{
axeOn = true;
hit.gameObject.transform.parent = transform;
hit.transform.localPosition.x = 1.027371;
hit.transform.localPosition.y = 0.2108669;
hit.transform.localPosition.z = 0.1075801;
hit.transform.localRotation.x = 0;
hit.transform.localRotation.y = 180;
hit.transform.localRotation.z = 0;
}
}
}
Okay the problem is here when i want to detect the collision between my axe and the tree. They both have a capsule collider in which i fixed properly but in the script they are not really colliding and thus nothing happens. Here is my script :
function OnCollisionEnter(theObject : Collision)
{
if(theObject.gameObject.name == "tree")
{
animation.Play("TreeAnimation);
}
}
but the collision is not occurring and nothing is happening could you tell me what my problem is.
thanks for your help
the