2D Toolkit Forum

2D Toolkit => Support => Topic started by: xhidnoda on August 17, 2013, 06:26:11 pm

Title: why the object game must be a convex in onTriggerEnter ?
Post by: xhidnoda on August 17, 2013, 06:26:11 pm
Because this require, i lose the collider shape.
When setup is not check the Convex box the onTriggerEnter not work.
When Convex box check  the onTriggerEnter work.

Why happen this?
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: unikronsoftware on August 17, 2013, 06:30:45 pm
2 non-convex mesh objects objects can't collide in Physx. One of them must be convex or use complex shapes (multiple boxes / convex shapes).
http://docs.unity3d.com/Documentation/Components/class-MeshCollider.html
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: xhidnoda on August 17, 2013, 07:56:03 pm
there is a any way to check convex of two object game and not lose the shape collider?
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: unikronsoftware on August 17, 2013, 08:28:40 pm
You can try to build the sprite out of multiple smaller sprites if you want. Also, only one of them needs to be convex for it to work. Its much better if you have your moving object as convex - performance is much much better. Moving compound / concave colliders is much much slower - if you could do it, make your primary mover a character controller or convex.
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: xhidnoda on August 18, 2013, 09:11:53 pm
and...nop
The solution "only one of them needs to be convex for it to work" is FALSE
:(
I can build the sprite muliple smaller sprites too :/
So, another way to resolve this "problem"?
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: unikronsoftware on August 18, 2013, 09:29:29 pm
By one of them needs to be convex I mean one of the 2 colliding bodies. convex - concave works. Concave - concave doesn't.
http://docs.unity3d.com/Documentation/Components/class-MeshCollider.html

If you're doing that and it doesn't work it probably means it isn't set up properly. Do you have a kinematic rigidbody set up on the moving convex shape?
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: xhidnoda on August 18, 2013, 09:57:06 pm
This is my setup.
PLS see for me and tell me what is wrong!
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: unikronsoftware on August 18, 2013, 10:07:18 pm
Which one are you moving?
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: xhidnoda on August 18, 2013, 10:15:52 pm
the player....moster and is not kinematic because is moving. Collection "Player"
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: unikronsoftware on August 18, 2013, 10:32:18 pm
If it moves it must be set as kinematic. Try setting them both to kinematic rigid bodies. Remember you want to try to move the convex one not the other.
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: xhidnoda on August 18, 2013, 11:15:15 pm
if my player set with kinematic in rigid body, in the console:
Actor::setLinearVelocity: Actor must be (non-kinematic) dynamic!

the only way for works the collision is if the two object is convex.
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: unikronsoftware on August 18, 2013, 11:41:19 pm
How are you moving the rigidbody?
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: xhidnoda on August 19, 2013, 02:14:22 am
you know a Playmaker Assent?
OK like this
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: unikronsoftware on August 19, 2013, 10:00:47 am
You can't SetVelocity on a kinematic rigidbody? You should move it using transform.position
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: xhidnoda on August 20, 2013, 04:25:17 am
no...nothing work.
:(
only work convex - convex
Title: Re: why the object game must be a convex in onTriggerEnter ?
Post by: unikronsoftware on August 20, 2013, 11:09:37 am
I've run out of things to suggest.
Please create a repro case and email to support at unikronsoftware dot com.