How to speed up?

I made a bow what shot an arrow and i want to the arrow stop when collision with a wall
the arrow’s script is now:

#pragma strict

function Start () {

}

function Update () {

}
function OnTriggerEnter (other : Collider) {
        rigidbody.isKinematic = true; 
    }

but sometimes its move through the walls and stop in the middle of the room in the air.
Help me please
Sorry for my bad english :slight_smile:

Just use Collider on your wall and don’t use isTrigger Property as true. if you translating object by code, it will not stop in some cases, use rigidbody and apply force to your bow

Go to the arrow prefab and uncheck “Trigger”.

Then , change

function OnTriggerEnter (other : Collider) {
    rigidbody.isKinematic = true; 
}

to

function OnCollisionEnter () {
    rigidbody.isKinematic = true;
}

Also, if your arrow moves at a high speed , it will sometimes not detect collisions.
Hope I helped :slight_smile:

Getting something to stop immediately turns out to be a somewhat hard problem, and I could only come up with a couple hackish solutions. The immediate issue may be solved by reducing the Fixed Timestep. From the edit menu, select Project Settings/Time. Reduce the Fixed Timestep from 0.02 to 0.01. As for other movement see this answer:

http://answers.unity3d.com/questions/462907/how-do-i-stop-a-projectile-cold-when-colliding-wit.html