How can this be accomplished? There are plenty of examples with mouse clicks or VR draggable but in case of trigger button on quest controller activating some script on object (not UI flat button) pointed by ray, I am lost there. A scene within a samples would be helpful
I see that DragControls.cs is empty, but I’ve found a js and ts files of the same name. Is the cs file just sort of a placeholder and we actually cannot write in c#?
Sorry to hear. May i ask what you were actually trying to do? Im still not sure what you meant by “activating” an object. Maybe its something that can be done using builtin components. E.g. if you just want to run some code on clicking an object (in VR or desktop) you can just add an ObjectRaycaster and a EventTrigger or Button component and use the UnityEvent for OnClick to run a function or play an animation
My choice of words there was bad - I am building a 3D design portfolio site and I the first thing I wanted to do is point to an object in space, pull trigger on Quest, and that would bring pointed 3D object within a certain distance and orientation (some will be billboard) - thinking script is simpler than Animator since user could move and I didn’t want to animate 50 objects
So a trigger would toggle a state on Component, or run a function to toggle between moving toward user, or back to original position
Discovering how to use TS on the go was hard, like why is there only a getter for .position (until I found I have to use set instaed of =)
I got stuck on the first thing with “SmoothDamp”
transform.position = Vector3.SmoothDamp(transform.position, targetPosition, ref velocity, smoothTime);
Took me long a time to find about built-in TWEEN library that seems to have alternative for SmoothDamp, but intelisense in VS was not giving me anything on how to use it
You can reuse the same Animator on any number of objects actually - what you describe should work pretty much “no-node”, as in, for clicking on something and having an animation play there’s no need to make custom scripts