Real Physics!
I have created a script that will through out the game, it will help us create a system to have real physics on objects, giving the player the ability to kick objects about and push things. It will also lead to the possibility of opening and closing doors. It's main reason will be for the puzzle including the photo frames shown in an earlier post, where the player can activity through the frames off to uncover clues.
function OnControllerColliderHit(hit:Co
{
if(hit.gameObject.tag=="ball")
{
Debug.Log("debug");
hit.rigidbody.useGravity = true;
hit.rigidbody.AddForce(transfo
print("hit ball");
}
// print(hit.gameObject.tag);
}
function OnCollisionEnter(hit : Collision)
{
if (hit.gameObject.tag == "Terrain")
{
print("floor hit");
// Don't let the rigidbody be affected by physics!
yield WaitForSeconds(7);
rigidbody.isKinematic = true;
}
}
Labels: Cameron
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home