Hello! I got a great problem with this...Making a grabPoint i got it working, but the player is a little far from grabPoint when grab the point...
I used this to get it on the right height(same of the grabPoint):
transform.position.y = collision.transform.position.y;
Ok, that is working. But Playermodel is a little far from the grabPoint in the axis Z (of the player)... Well i would do the same thing in the Z axis, but it doesn`t work.`Cause it is about global axis, i need local(some grabPoint would be rotated and that`s the problem)...maybe something about localPosition would help, but not with the same sintax...i tried it before...
[EDIT] I'm using this code:
function OnTriggerEnter(collision : Collider) {
if (collision.gameObject.tag == "grabPoint") {
grab=true;
nogravity=true;
transform.position.y = collision.transform.position.y;
transform.position.z = collision.transform.position.z;
transform.eulerAngles.y = collision.transform.eulerAngles.y;
}
}
Please help me!!!
Thank you Guys! =D