• Hi Guest!

    We are extremely excited to announce the release of our first Beta for VaM2, the next generation of Virt-A-Mate which is currently in development.
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.

Question How to access whether collision trigger is active

el_gallo

Member
Joined
Mar 17, 2023
Messages
27
Reactions
2
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