Page 1 of 1

Trigger not trigged when not walk

Posted: Sun Jan 12, 2020 1:36 pm
by parapoohda
When character is not walking it does not trigged trigger. Is this normal? Or I done something wrong.

Re: Trigger not trigged when not walk

Posted: Sun Jan 12, 2020 5:48 pm
by Norbo
Is the character asleep? Collision detection won't run on sleeping pairs.

You could set the trigger's sleep threshold to -1 to force it to be always active.

Re: Trigger not trigged when not walk

Posted: Tue Jan 14, 2020 5:42 am
by parapoohda
Will it make bepu slow? Thank you. :D :D

Um I alway use BodyActivityDescribetion(-1)

I don't know what does it mean thought I just copy it from kinematic in character demo

Code: Select all

var handle = Simulation.Bodies.Add(BodyDescription.CreateKinematic(trigger.StartPosition, collidable, new BodyActivityDescription(-1)));
So it may be another problem

Is it relate to thing I modify in character update goal?

Code: Select all

/* (!characterBody.Awake &&
                    ((character.TryJump && character.Supported) ||
                    newTargetVelocity != character.TargetVelocity ||
                    (newTargetVelocity != Vector2.Zero && character.ViewDirection != viewDirection)))
                {*/
                simulation.Awakener.AwakenBody(character.BodyHandle);
                //}
                character.TargetVelocity = newTargetVelocity;
                character.ViewDirection = viewDirection;
Or it is relate to that I make it stop by update character goal to 0,0

I try to force awaken trigger and character by use

Code: Select all

Simulation.Awakener.AwakenBody(bodyHandle);
but not success.

it seem there are no kinemetic and dynamic pair in configure contact manifold.
Is kinemetic does not collide with stop body?

Should I use dynamic instead.

and make my DemoPoseIntegratorCallbacks

Update:
Sorry _(_ _)_

It not detect walk character
but it send trigger position back incorrectly.
I see it at character but it is infront of character so it need to walk forward to inside trigger.

Re: Trigger not trigged when not walk

Posted: Tue Jan 14, 2020 8:54 pm
by Norbo
Sounds like you figured it out, but here's some more background information:
Will it make bepu slow?
Probably not! :)

If there are way more triggers than characters, the characters could be the ones perma-active instead.
new BodyActivityDescription(-1)
This just sets the sleep threshold at -1, and since velocity magnitude can't go negative, the object can't go to sleep. It's a perfectly valid way of keeping an object permanently awake.
simulation.Awakener.AwakenBody(character.BodyHandle);
Notably, unconditionally calling this every frame is redundant with setting the character's sleep threshold to a negative value.
Is kinemetic does not collide with stop body?
Sleeping bodies of any type (and statics) will not generate collision tests with each other.

Re: Trigger not trigged when not walk

Posted: Thu Jan 16, 2020 2:38 am
by parapoohda
Thank for the information. :D :D