My purpose is making object in game move to widget component when i click on it and destroy it at the end (kind of pvz sun pick up). To achieve this i need to know widget component location. The only way i found is getting position of component as canvas slot and converting position in world location by node “Convert screen location to world space”. The problem is that component position doesnt changes due to screen size changing, and i think problem would be solved if i could multiply dpi scale of widget to position and then use this node. Can i get dpi scale, or even there is easier way to realize this logic?
Get Mouse Position Scaled by DPI function
I need widget component location scaled by dpi, when i pick up object my mouse locates on this object position. Or if ill divide mouse pos by dpi by default mouse pos ill get dpi scale?
I solved the problem. “Get viewport scale” node returns you DPI scale and multiplying it by widget component position works as it has be.
1 Like
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.