Dragging objects when scene size is larger than screen size
jrj.clark
Member, PRO Posts: 17
Hi there,
I want to move touch an object and drag it around the screen. This is fairly easy: just constrain x and y to touch x and y.
However, the scene height is twice the screen height. Therefore, if I touch an object when the screen is showing any of the upper half, 'touch y' registers the touch in relation to the screen, not the scene. As a result, when I touch an object it jumps further down the screen to the 'correct' scene y position. I know I need to offset for the camera location, but this is an object that will spawn into the game so I can't unlock the behaviours for the object in the scene.
Any ideas on how I can resolve this?
Thanks
Comments
Add camera origin x and camera origin y to your constrain x and y.
I thought it wasn't possible to add 'camera origin' to the prototype actor? I can't find it listed. My actors aren't starting off in the scene, instead they are spawning into the scene.
Use Game.attributes to apply the camera origin offset.