• Hi Guest!

    We have posted a new VaM2 dev log on Patreon, starting a monthly cadence of written progress updates between Beta releases. Highlights include the new Gizmos System, Selection Carousel, and Modes System with Context-Specific Editing. Beta1.2 is 15 of 21 items complete.

    Read the full post on Patreon, or follow progress on the public Trello roadmap.

Question How to access whether collision trigger is active

el_gallo

Member
Joined
Mar 17, 2023
Messages
27
Reactions
3
I'm developing a new VaM plugin. I've created TriggerActionDiscrete handlers for trigger start actions. However, I have noticed that what I really need for my plugin is either a handler or some way to access whether a trigger is active in my plugin's Update function. I know VaM is tracking it somehow to show these green and red values in the picture. They presumably map to some bool or handler in the trigger's classes but I haven't found it yet.

Can anyone tell me where in the code I can access this bool value and/or create a handling action for it?

Green trigger.jpg
 
Okay. Cobbled this together from the vamX plugin's code and it seems to work in my Update function:

C#:
Rigidbody rigid = containingAtom.rigidbodies.First(rb => rb.name == "lNippleTrigger");
Dictionary<Collider, bool> d = rigid.GetComponent<CollisionTriggerEventHandler>().collidingWithDictionary;
if (d.Count > 0)
{
    SuperController.LogMessage($"LNipple ACTIVE");
}

Please let me know if there is a more efficient method.
 
Upvote 0
Back
Top Bottom