I’m passing the position of the collider to the PlatformerController script to perform some calculations on it, but get an error saying I can’t perform operations on an ‘Object’ with a ‘Vector3’. What do I need to do to make the passed transform.position into a Vector3?
function OnTriggerEnter(hit : Collider) {
if (hit.transform.name == "Grabber") {
var platformerController : PlatformerController = hit.transform.parent.GetComponent(PlatformerController);
// Send ledge position
platformerController.GrabMe(transform.position);
}
}
function GrabMe (ledgePosition) {
var ledgeOffset = Vector3(0, 0, 0);
transform.position = ledgePosition - ledgeOffset;
}