- 2020-12-24 at 8:22 am #36866Yuri KovelenovDeveloper
We checked our git logs, and it appears we did not change this specifically in version 3.5. I don’t know why is that. Looks pretty strange.
Anyway, in our opinion, the behavior is correct for the following case: if nothing is picked then the picked object global variable is set to empty string.
Still, I think you can easily reproduce the desired behavior by creating a variable puzzle and setting it to some object that you want to be saved as picked (or some object that was actually picked by the user). Then you can just update this variable only if the picked object puzzle returns not empty string.
2021-01-11 at 11:26 pm #37252
- This reply was modified 4 weeks, 1 day ago by Yuri Kovelenov.
I noticed the same thing with 3.5 today (not the actual code in visual_logic.js) but the behavior. We used to have a functioning set of puzzles that used to have the clicked object stored in “picked_object” even if we did not use the “when_clicked” event, and now it does not, making our solution stop from working. We were using this for a configurator and we were monitoring if users clicked on an object to make the e-commerce solution to jump to the step associated with that object. Now that jump is not working after updating/saving the puzzles.
Please help! Thank you.
Andrés2021-01-12 at 7:36 am #37270Yuri KovelenovDeveloper2021-01-12 at 3:13 pm #37310
Not necessarily a bug, but certainly something that works differently from earlier versions. I have to admit I’m not sure if this changed from 3.5 on, or it was already present in previous versions. I have been working on projects that did not involve verge3D for a long while (most of past year). I decided with the new year that it was about time to update older projects (locally first, of course) to the latest stable version and after updating I noticed that this functionality had ceased to work, and when looking for related issues I found this post.
Stay tuned, thank you.
Andrés2021-01-12 at 7:50 pm #37320
I hope this helps. Thanks a lot in advance!2021-01-12 at 7:53 pm #37321
Oops, sorry about that. It seems the zipped file is slightly larger than 4MB. I just uploaded it to our server: http://normalcreatures.com/picked_object/click-drag.zip
Andrés2021-01-18 at 10:26 pm #37468jdockLicensee
Is there an issue if you added the functionality to the ‘when clicked’ event to return the mesh object name in PickedObject even if it is not the target of the When Clicked event? I know it is not the intent of the When Clicked, but it was how it worked prior to 3.5.
If this is not possible, maybe some help developing a ‘Get Picked’ puzzle. The issue is really for projects like mine where a lot of cloning is involved and an elegant way of interacting with the cloned objects is needed. Basically I need a puzzle to just return PickedObject no matter what mesh is picked. This avoids creating a bunch of When Clicked events for each clone. I used conditions based on the mesh name to determine actions. If you are careful with the mesh names (like using a . at the end of the name) the clone name is predictable.
Jon2021-01-19 at 1:50 am #37471GlifTekLicensee
So let me get this straight Jon.
You want to return only the “name”, not the actual js object of ANY object you click? Is that correct?2021-01-19 at 2:09 am #37473jdockLicensee
Correct – I believe just the object name will work. A few post in this thread I show how I modified the visual_logic.js to get it to work. I believe what I did there just returns the name, not the actual js object. This workaround works, but I want to avoid editing the visual_logic code if possible.
Jon2021-01-19 at 8:45 pm #37508GlifTekLicensee
try using the “create text with” puzzle in the text section.
go into the gear setting and remove one block so there’s only one input then put it between a set variable and picked object.
then print to console the variable.
that’s an easy trick. if you want you can always just go get it …
you could set the picked object to a variable pickedObj then toss that variable into the exec code puzzle and get it’s name there. ie:
VARS[‘pickedObjName’] = VARS[‘pickedObj’].name;
- This reply was modified 2 days, 23 hours ago by GlifTek.
- You must be logged in to reply to this topic.