• Hi Guest!

    We are extremely excited to announce the release of our first Beta1.1 and the first release of our Public AddonKit!
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. For access to the Public AddonKit you must be a Creator tier member. 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.
  • Hi Guest!

    VaM2 Resource Categories have now been added to the Hub! For information on posting VaM2 resources and details about VaM2 related changes to our Community Forums, please see our official announcement here.
AtomClickTrigger (VR Ready)

Plugins + Scripts AtomClickTrigger (VR Ready)

Download [<1 MB]
※ Reporting bugs or issues will help me improve the plugin and help others.
AtomClickTrigger

● This can be triggered by clicking on the Atom like a button.
● Just add this plugin to the Atom.
● Define Triggers based on mouse Hover-in/out, click. In particular, it provides a toggle function to turn it on/off.
● CUA is now also supported (v0.2)
● VR Controller is now supported (v0.3)
● VR Head Hover/Click is now supported (v0.4) - If the VR Head is hovering, you can click with mouse or controller L/R.
● Implements accurate shape selection (v0.5)

● Person's part (hand, foot, breast, eye .... etc) selection is not yet supported. I will implement it in the future. (maybe next next version)
● Person's clothing selection is not yet supported. I will implement it in the future. (maybe next next next version)

● In VaM, there are cases where a shape's scale is set to below approximately 0.3.
● At this scale, the ray range no longer decreses, which causes issues with selecting objects.
● Rather than being a bug in VaM, it might actually be an intentional design choice by the developer to improve detection accuracy for very small objects—specifically those below 0.x in size.
● This issue has been observed with Shape atoms such as Capsule, Cube, Sphere, ISCapsule, ISCone, ISCube, ISCylinder, ISSphere, and ISTube. Other atom types have not yet been tested.
● You can see this behavior in the screenshot below.
● I attempted to development the MeshCollider and related components to achieve accurate raycast range, but ultimately abandoned the approach due to side effects, inconsistent implementations across as each types, and most importantly, unnecessary overhead caused by the additional mesh structures.
MeshColliderRayTest.jpg
● Instead, I used the VamObjectExplorer tool I previously developed to debug how scale changes affect the interaction range.
● The root cause of the issue was that when the scale is changed, only the rescaleObject is modified, while the scale value is not applied to the ShapeCollider and RigidBody components of the mainController.
● Therefore, I implemented the code as shown below and tested whether precise raycasting is possible for nine types of shapes: Capsule, Cube, Sphere, ISCapsule, ISCone, ISCube, ISCylinder, ISSphere, and ISTube.
C#:
public override void Init()
{
    if (TYPESHAPE.Contains(containingAtom.type))
    {
        IS_SHAPES = true;
    }
}

public void FixedUpdate()
{
    patchScaleOfShape();
}

private bool   IS_SHAPES = false;
HashSet<string>TYPESHAPE = new HashSet<string> { "Capsule", "Cube", "Sphere", "ISCapsule", "ISCone", "ISCube", "ISCylinder", "ISSphere", "ISTube" };
Transform      t_rescale = null;
Transform      t_control = null;
private long   timeofchk = -1;
void patchScaleOfShape(bool forcednow=false)
{
    if (IS_SHAPES)
    {
        long time = DateTime.Now.Ticks/10000; // msec
        if ((time - timeofchk) < 1000 && forcednow == false) return; else timeofchk = time; // check every 1sec
        if (t_rescale == null) t_rescale = containingAtom.reParentObject.Find("object/rescaleObject");
        if (t_control == null) t_control = containingAtom.mainController.transform;

        if (t_rescale.localScale != t_control.localScale)
        {// compare rescale vs controller scale
            if (DBGLOG) SuperController.LogMessage($"[INF] scale patch : {t_rescale.localScale} to {t_control.localScale}");
            t_control.localScale = t_rescale.localScale;
        }
    }
}
● As shown below, precise selection is possible even at a scale as small as 0.001.
● To uncover this, I used VamObjectExplorer, a plugin I proudly developed myself. I was so thrilled with it, I celebrated for two whole days! :D
● I conducted tests on a total of nine shape types, categorized as follows: Capsule, Cube, Sphere, ISCapsule, ISCone, ISCube, ISCylinder, ISSphere, and ISTube.
● At long last, We can finally operate the spaceship dashboard with precision!!! :cool:
● Please refer to the demo below for more details.
● Accurate selection is now possible for Shape Atoms.

● UI fully Modification
14mhz.Plugin-AtomClickTrigger.5.UI.jpg
● Max Clickable Distance (meter)
- It is possible to specify the Maximum Clickable Distance.
● VR Head Hovering
- The center point of the VR Head and the center point of the Desktop are functionally the same.
- Hovering is possible with the position of the VR Head's viewing center point, and triggering is possible with mouse or controller L/R.
- Also, It is also supported in Desktop Mode Experimentally.
● VR Head Hovering - Support in VR Mode


● VR Head Hovering - Support in Desktop Mode

● Demo Update : Now the elevator door in the demo can be opened and closed using the SecondHandle Plugin without an any AnimationPattern.

14mhz.Plugin-AtomClickTrigger.1.UI.jpg

20250202 AtomClickTrigger Flow simple.jpg

20250202 AtomClickTrigger Flow UIElement.jpg
1. Trigger to SliderFloatValue
Atom-to-Atom interaction is always expensive.
For example, if you install ClickTrigger on one atom and successively call SliderFloatValue on another atom, a bottleneck will occur.
I discovered this problem in the process of installing and calling a separate Atom on the knob to open it by applying an animation effect to the Atom that serves as the gate.
However, I have confirmed that when both ClickTrigger and SliderFloatValue exist in one atom, no bottleneck problem occurs even when called.
Perhaps, if you install ClickTrigger on Atom in the future, you may need to add an area click function rather than an entire click function.

2. Ray Detection
When adjusting the scale of a Shape (Sphere) (for example, setting the scale to 0.2), the actual detectable range is much wider than the actual size.
Assumed, when the scale is reduced, the size of the collider does not appear to be reduced below a certain size.

3. Issues with using multiple AtomClickTriggers
Raycasting is quite expensive in terms of performance.
If you attach an AtomClickTrigger to 100 atoms, the system has to process 100 separate raycasts.
To optimize this, a more efficient approach would be to place a single AtomClickTrigger on an Empty Atom and use more than 10 Tabs, each configured to target a specific receiver Atom.
This way, only one raycast needs to be processed.
----------------------------------------
Example Demo Scenes
I was able to create a this demo thanks to Farger's Amazing Assets. Always Thanks Farger !
I was able to create a this demo thanks to Farger's Amazing Super Car. Always Thanks @Farger !
Additionally, Embody from Acid Bubbles, a legendary Plugin, was used. Thanks too @Acid Bubbles !
Also, The SecondHandle Plugin was used to open the door when clicked.
The Jump Plugin was used to move position when clicked.
React to this content...

Share this resource

More resources from 14mhz

Latest updates

  1. AtomClickTrigger v0.5 20251031

    ● Accurate selection is now possible for Shape Atoms.(report by @CheekiBreeki) ● UI fully...
  2. AtomClickTrigger v0.4 20250224

    ● add : VR Head Hover/Click Support (in VR/Desktop Mode) ● add : Max Clickable Distance ● fix ...
  3. AtomClickTrigger v0.3 20250208

    ● add : VR Controller support (request by huiyu914) ● fix : minor bug fix

Latest reviews

Positive
Version: 5
Posted:
thank you v much i was about to implement a button scheme like this the dumb way with individual cube atoms, so you saved me a lot of time
14mhz
14mhz
I appreciate your feedback !
Upvote 0
Positive
Version: 4
Posted:
Awesome plugin for natural interactions
14mhz
14mhz
Thanks to your review and reaction !
Upvote 0
Positive
Version: 4
Posted:
This plugin is awesome, thank you
i wonder if you could add option so, after a certain number of click, a different trigger can be activated (climax for example)..thank you =)
14mhz
14mhz
Thanks for your feedback. I'm working on a new plugin that takes over that role.
Upvote 0
Positive
Version: 3
Posted:
Very useful function! mouse not just mouse.
14mhz
14mhz
I appreciate your feedback.
Upvote 0
Positive
Version: 3
Posted:
This makes the scene very smart.
14mhz
14mhz
Thanks for your feedback. I miss you ㅠㅠ
Upvote 0
Positive
Version: 3
Posted:
Oh shit. This is really unbelievable. You're a genius, and I'm going to be using it in all my future scenes. This plugin is insane.
14mhz
14mhz
I really appreciate your kind words and generous feedback.
Upvote 0
Positive
Version: 3
Posted:
This is massive. Finally anything can be a button!
14mhz
14mhz
Thank you for the review !
Upvote 0
Back
Top Bottom