x


Rigidbody object falling through floor.

I have a rigidboy object that needs to act as a trigger, is has a rigidbody/mesh collider/mesh renderer/mesh filter attached to it. The collision object is positioned on the floor beneath it, it has a mesh filter and a mesh collider, it has an emitter attached to it which is coded to turn on when the collision is true.

going back to the rigidbody, the convex is ticked and the is trigger is ticked on the mesh collider, this is because it needs to work with its colliding object, but the problem I have is that the object keeps falling through the floor when is trigger is ticked.

When i remove the is trigger tick, it doesnt fall through the floor, but it doesnt act as a trigger which I need it to.

If this doesnt make much sense, please see this thread i made about another previous issue...thanks. link text

more ▼

asked May 22 '12 at 02:14 AM

Lboy gravatar image

Lboy
36 7 13 18

If you have that waterfall plane's collider set isTrigger and your trigger script on it, then the rock with collider not set isTrigger should fire that script and keep your rock from falling through the ground.

May 22 '12 at 02:17 AM Lo0NuhtiK

but if the rock collider isTrigger isnt set, how will it tell the plane collider the collision is true? I tried your method but didnt get much luck.

May 22 '12 at 11:56 PM Lboy

Should work. Just copy/pasted that C# code I posted the other night in a script (deleted the non-drag&drop emitter stuff off of it) , attached it to a game object, put a collider on it with isTrigger set. Then put a child object on that with a particle emitter/animator/renderer. Drag/dropped the child object onto the parents script slot for the emitter object. ... Then made another object with a rigidbody and collider not trigger, tagged it as "Rock" , moved it into the trigger in play-mode and it shut the emitter off. Moved it out, emitter turned back on.

May 23 '12 at 12:11 AM Lo0NuhtiK

I'm attempting this now, but i keep getting the following error, "A namespace can only contain types and namespace declarations" on lines 4, 6 & 11.

May 23 '12 at 01:04 AM Lboy

Ok I got around that issue, and i followed the rest of your steps, but the emitter is still not reacting to the rigidbody when they come into contact alt text

alt text

May 23 '12 at 02:21 AM Lboy
(comments are locked)
10|3000 characters needed characters left

5 answers: sort voted first

attach a collider to it (box collider recommended)

more ▼

answered Nov 20 '12 at 12:34 AM

crummyrex gravatar image

crummyrex
-4 2

hey thanks for the help, I've long since abandoned this particular project but when dealing with rigidbody issues in the future, I'll bare this in mind.

Nov 20 '12 at 09:47 PM Lboy
(comments are locked)
10|3000 characters needed characters left

Uncheck the Use Gravity option on your rigidbody to prevent gravity from being applied to it.

more ▼

answered May 23 '12 at 12:14 AM

e.bonneville gravatar image

e.bonneville
5.7k 100 116 165

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

Ok ive figured it out, the waterfall trigger needs convex ticked. work fine now. Thanks guys

more ▼

answered May 23 '12 at 03:09 AM

Lboy gravatar image

Lboy
36 7 13 18

Do not ever write the comments in the answer section.

May 23 '12 at 04:54 AM venkspower
(comments are locked)
10|3000 characters needed characters left

you could always just change your rigidbody to "isKinematic" to prevent it from falling.

more ▼

answered May 22 '12 at 02:20 AM

stingman gravatar image

stingman
562 24 29 33

I tried this but its doesnt move what so ever

May 22 '12 at 11:49 PM Lboy
(comments are locked)
10|3000 characters needed characters left

isTrigger will make that collider pass through other colliders so you might make another collider a child that will be affected by physics or use OnCollisionEnter.

more ▼

answered May 22 '12 at 04:33 AM

Unk gravatar image

Unk
0

Thanks this might explain the whole issue, I take it OnCollisonEnter would mean I would have to re-write the script into Java?

its currently this in C#...

public class Waterfalltrigger : MonoBehaviour {

ParticleEmitter myEmitter ;

void Start(){ myEmitter = GetComponentInChildren() as ParticleEmitter ; }

void OnTriggerEnter(Collider other){ if(other.CompareTag("Respawn")) myEmitter.emit = false ; }

void OnTriggerExit(Collider other){ if(other.CompareTag("Respawn")) myEmitter.emit = true ; } }

May 22 '12 at 11:58 PM Lboy

the "Respawn" tag is given to my rock

May 23 '12 at 12:01 AM Lboy
(comments are locked)
10|3000 characters needed characters left
Your answer
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:

x1781
x61
x32
x10

asked: May 22 '12 at 02:14 AM

Seen: 3673 times

Last Updated: Nov 20 '12 at 09:47 PM