[HELP]Camera move

Get help using Construct 2

Post » Fri Dec 16, 2011 10:30 pm

Hey guys,
i wanted to make a camera that follows the mouse in the map,but,if i simply make the event:
Every tick - Scroll to mouve
the camera movement will be too fast,i wanted some way to control the scrolling speed.
so,i tried putting an invisible object in the middle of the screen,and using a scroll to behavior in the object(the object will be called camera).Then,buttons around the screen,that once clicked:

Left button clicked                         -Camera Y,X-5
Mouse overlapping left button(the object)   -

then,the object will follow the commands and go to left,the camera will follow him,and then,i have a camera scroll system.
However,let's say i got in right edge,then,if i try hitting the left button,it will take some time until the object gets in the left side,and that shouldn't happen.
Sooooooooooooooooooooooooooooo any ideas?
Thanks
B
16
S
5
G
1
Posts: 43
Reputation: 1,787

Post » Fri Dec 16, 2011 11:28 pm

every tick system set scroll.x to lerp(scroll.x,mouse.x,1-0.5^dt), set scroll.y to lerp(scroll.y,mouse.y,1-0.5^dt)
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Sat Dec 17, 2011 3:10 pm

Thanks,but now i solved the prob :D
B
16
S
5
G
1
Posts: 43
Reputation: 1,787


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, anty21ro, MChiz, Radulepy and 0 guests