Hello Guest

Author Topic: why the object game must be a convex in onTriggerEnter ?  (Read 11655 times)

xhidnoda

  • Newbie
  • *
  • Posts: 25
    • View Profile
why the object game must be a convex in onTriggerEnter ?
« 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?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: why the object game must be a convex in onTriggerEnter ?
« Reply #1 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

xhidnoda

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: why the object game must be a convex in onTriggerEnter ?
« Reply #2 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?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: why the object game must be a convex in onTriggerEnter ?
« Reply #3 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.

xhidnoda

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: why the object game must be a convex in onTriggerEnter ?
« Reply #4 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"?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: why the object game must be a convex in onTriggerEnter ?
« Reply #5 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?

xhidnoda

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: why the object game must be a convex in onTriggerEnter ?
« Reply #6 on: August 18, 2013, 09:57:06 pm »
This is my setup.
PLS see for me and tell me what is wrong!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: why the object game must be a convex in onTriggerEnter ?
« Reply #7 on: August 18, 2013, 10:07:18 pm »
Which one are you moving?

xhidnoda

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: why the object game must be a convex in onTriggerEnter ?
« Reply #8 on: August 18, 2013, 10:15:52 pm »
the player....moster and is not kinematic because is moving. Collection "Player"

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: why the object game must be a convex in onTriggerEnter ?
« Reply #9 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.

xhidnoda

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: why the object game must be a convex in onTriggerEnter ?
« Reply #10 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: why the object game must be a convex in onTriggerEnter ?
« Reply #11 on: August 18, 2013, 11:41:19 pm »
How are you moving the rigidbody?

xhidnoda

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: why the object game must be a convex in onTriggerEnter ?
« Reply #12 on: August 19, 2013, 02:14:22 am »
you know a Playmaker Assent?
OK like this

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: why the object game must be a convex in onTriggerEnter ?
« Reply #13 on: August 19, 2013, 10:00:47 am »
You can't SetVelocity on a kinematic rigidbody? You should move it using transform.position

xhidnoda

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: why the object game must be a convex in onTriggerEnter ?
« Reply #14 on: August 20, 2013, 04:25:17 am »
no...nothing work.
:(
only work convex - convex