Page 1 of 1

Camera Script Not Working.

Posted: Tue Jun 16, 2015 3:16 am
by Ethan-Taylor
Hey guys,
The following code doesn't quite work for the camera script located from 118 - 152 in main.lua.
I've used a cursor follow script that micha gave me a while ago, it doesn't quite work with the camera.
Any help?

Thanks, and sorry for spamming you with questions XD

Re: Camera Script Not Working.

Posted: Tue Jun 16, 2015 8:46 am
by vladgalay
I think i fixed it. I just changed lines 45 and 46 from this:

Code: Select all

rotcalc.x = love.mouse.getX() - movement.x
rotcalc.y = love.mouse.getY() - movement.y
To this:

Code: Select all

rotcalc.x = love.mouse.getX() + camera.x - movement.x
rotcalc.y = love.mouse.getY() + camera.y - movement.y
The file is in attachment

Re: Camera Script Not Working.

Posted: Tue Jun 16, 2015 10:10 pm
by Ethan-Taylor
vladgalay wrote:I think i fixed it. I just changed lines 45 and 46 from this:

Code: Select all

rotcalc.x = love.mouse.getX() - movement.x
rotcalc.y = love.mouse.getY() - movement.y
To this:

Code: Select all

rotcalc.x = love.mouse.getX() + camera.x - movement.x
rotcalc.y = love.mouse.getY() + camera.y - movement.y
The file is in attachment
Thanks, It works :D