简体   繁体   中英

Dragging UI elements doesn't work in 3D Unity

i was trying to make drag system in my game, basically i needed to make Inventory slot follow Player Cursor when clicked on it so player can move it around, i tried using Input.mousePosition (which doesn't work and i knew it but i just tried it) and then everything in cam.ScreenTo functions, what i think is that i try to use 2D version on 3D camera, but the problem is that when i try to use 3D version it still doesn't work, i watched alot of YT tutorial and none of them were working, is there any way how to do it? And also, if someone wouldn't get it i need something like in Minecraft, basically i just need UI element to follow the Cursor

i was trying to make drag system in my game, basically i needed to make Inventory slot follow Player Cursor when clicked on it so player can move it around, i tried using Input.mousePosition (which doesn't work and i knew it but i just tried it) and then everything in cam.ScreenTo functions, what i think is that i try to use 2D version on 3D camera, but the problem is that when i try to use 3D version it still doesn't work, i watched alot of YT tutorial and none of them were working, is there any way how to do it? And also, if someone wouldn't get it i need something like in Minecraft, basically i just need UI element to follow the Cursor

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM