x


Collisions in ThirdPersonCharacterController

Hey all.

I'm using the OnControllerColliderHit function with the ThirdPersonCharacterController script.

There is one type of object, a rope, that I made where I trigger the collision within the function like this:

if (hit.collider.gameObject.tag == "rope") { ropeGrab = true; Physics.IgnoreCollision(this.collider, hit.collider); }

I need to do the ignore collision because if I don't, the rope swings around like crazy, and I can't get the behavior I want. All the movement on the rope is done elsewhere in the script when ropeGrab == true.

The problem is that the first 2-3 times I hit the rope, it triggers the condition correctly. But after that, hitting the rope in the same exact spots does not trigger this condition any longer. It's almost like the collider on the rope just stops working. I've tried this with multiple ropes, and the same thing happens with each rope, where you can hit each one a few times, and then no longer. I've put in a debug message, and the processing doesn't even make it INTO the OnControllerColliderHit function when you hit the rope after it stops working. You can still collide with all other objects though.

Anyone have any ideas?

more ▼

asked Oct 15 '11 at 06:34 PM

mattbrand gravatar image

mattbrand
1 1 3 3

(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:

x2482
x1682
x46
x31

asked: Oct 15 '11 at 06:34 PM

Seen: 452 times

Last Updated: Oct 15 '11 at 06:34 PM