Drag e Drop object in VR

Hello everyone!
Is there any way to drag and move objects once the simulation is started in VR or AR?


Hi @Luca_D_Agostino,

I never try out the vr feature in cospaces, but I’m pretty sure you can move objects in play mode, however, dragging even on desktop is only accessible with typescript.

Hi @Bladebob20000 ,

Thank you for the information.
Can you tell me where I can find some example code to test so I can better understand how it works?

@Luca_D_Agostino Hey Luca, I dont know much about typescript though I did think of (what might be) another solution; By setting an on click event and making the item move with the camera, perhaps this isn’t quite what you were looking for in which case I hope somebody can give the example with typsecript, but maybe this does end up helping in some way or another, eitherway best of luck!

(Footnote, I also actually don’t know if on click events are even a thing in vr/ar, well I hope so else I guess my solution isn’t much of a solution after all haha.)

1 Like

@Luc Thank you! sounds like a good solution to me.
So you can move the object along one axis, can you also give me some pointers to move it along all axes?

@Luca_D_Agostino No problem, glad I could help; Here I’ve added movement using the arrowkeys, I made it so up and down move forwards and backwards but you could change this to be up and down (though limiting the movement especially on the downwards axis would be a smart choice in that case).

Also the speed of the movement can be changed in the function parameters, this is when the block is called in the when play clicked part. The first parameter is interval increasing this will cause the movement to be more smooth but also prolonged kind of like its gliding on ice, and the second parameter is the speed in Meters per Second which well does what it says. Hope this helps!

Ah yes… Vr/Ar I just remembered haha, well you could make it so that instead of the up/down/left/right keys, you have buttons on the screen instead. Hope this will work!

@Luc Thank you for this interesting upgrade.

Would you have time for a chat? I would like to describe the project I have in my head, maybe you can give me some interesting insights

@Luca_D_Agostino I’m actually off to go do something right now, but I’ll be back in about 2 hours or so. You could send me a private message if you’d like, I’d be happy to hear your idea

@Luc I can’t send private message, if you could write to me I’ll respond to you

Added a height check for the drop indicator, making it show up even when there is an item above it, looking around now changes the position, if it’s colliding height will be adjusted.

Thank you very interesting!
Next week I’m going to devote myself to creating learning environments


@Luca_D_Agostino Curious as to how it will turn out, feel free to send me a message if you need help with anything!