I want my "Jumper" object, to access the Rigidbody on my Player.
And add a force to that. Searched for hours to find answers on google. but nothing. Followed all guides i could find.
I got this:
#pragma strict
var thePlayer : GameObject;
var jumpForce : int;
function Start () {
}
function OnTriggerEnter (other : Collider) {
rigidbody.AddForce(Vector3.up * jumpForce);
Debug.Log("Trigger Entered");
}
But i dont know, how to target other objects, with rigidbody.
↧