x


Character Controller collision speed

I have a bunch of blocks which I want interact with when they collider with my Character Controller. Here is the code I am using:

function OnControllerColliderHit(hit : ControllerColliderHit)
{
    renderer.material.color = Color.blue;

    if(hit.gameObject.tag == "Block")
    {
         var block;
         block = hit.gameObject.GetComponent("Block");
         block.collide();
    }
} 

It works, but it's quite slow in computing the collision, there is about a half second delay before the block's collide() method is called.

Is there a faster way to check for collisions with rigidbodies and a character controller?

more ▼

asked Oct 21 '10 at 11:01 AM

Disaster gravatar image

Disaster
482 48 57 67

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5053
x1864
x1781
x669

asked: Oct 21 '10 at 11:01 AM

Seen: 1165 times

Last Updated: Oct 21 '10 at 11:01 AM