x


Problem with "sticking" to a block.

Basically I have a character, when it hits a block it sticks to it and gravity stops taking a hold. When it's pulled away it unsticks. This is handled with a basic onCollisionEnter and onCollisionExit (This script is attached to the character). It's all working fine. The problem arises when the block that it is stuck to is destroyed, sometimes this might happen because of a nearby explosion or something. onCollisionExit isn't called when it's destroyed so the character remains stuck in empty space. Does anyone have an idea how I might solve this?

EDIT: Sorted by constantly checking if it's still colliding with the block by recording the objects name when colliding with it and checking if the object still exists.

more ▼

asked Sep 07 '10 at 12:11 PM

ROM gravatar image

ROM
277 46 49 58

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

x2584
x59
x58
x24

asked: Sep 07 '10 at 12:11 PM

Seen: 388 times

Last Updated: Sep 07 '10 at 01:23 PM