I’ve made it so that you use the scroll wheel to zoom in and out on the screen, however when I do this the cursor game object position changes from the position of the mouse and the two do not seem to match up. I’ve heard that you can use something called ‘rendercam’ to solve this however I can’t for the life of me figure out how do this. How do you add this in order to achieve this effect?
Yeah, rendercam has a rendercam.screen_to_world_2d()
that you can use to convert screen position to world position. You can use it like this:
function on_input(self, action_id, action)
if not action_id then
local pos = rendercam.screen_to_world_2d(action.screen_x, action.screen_y)
go.set_position(pos)
end
end
This is also assuming you’re using a GO for the mouse.
I did have problems with it being offset with different window resolutions, but I used action.x/y
instead, so I’m not not sure if the offset will still be there.