playMaker

Author Topic: 2D camera parallax  (Read 341 times)

QueenM56

  • Junior Playmaker
  • **
  • Posts: 55
    • View Profile
2D camera parallax
« on: June 13, 2018, 01:45:02 AM »
Hi all,

I'm trying to create the camera parallax effect for my 2D game.
I was hoping to know what is the best way to do it...
I'm currently using the perspective camera and put the flat images in different Z distance.
It works functionally, but when the camera moves up and down it reveals some bad views of 2D images.
I was wondering if there is a better way to do it besides the perspective camera.

Cheers,
M

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 845
    • View Profile
    • Fat Pug Studio
Re: 2D camera parallax
« Reply #1 on: June 13, 2018, 09:14:13 AM »
2D with perspective camera? But why? Swotch to orthographic, and problem solved.

QueenM56

  • Junior Playmaker
  • **
  • Posts: 55
    • View Profile
Re: 2D camera parallax
« Reply #2 on: June 13, 2018, 06:43:53 PM »
Because I want to create parallax camera effect
The off set layer will have no effect with orthographic camera.
what's the best way to create parallax effect with orthographic camera?

Cheers,
M

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 845
    • View Profile
    • Fat Pug Studio
Re: 2D camera parallax
« Reply #3 on: June 14, 2018, 08:35:57 AM »
Just give the layers a different z transform values or use sorting layers to put them one behing another and move them at different speeds.

QueenM56

  • Junior Playmaker
  • **
  • Posts: 55
    • View Profile
Re: 2D camera parallax
« Reply #4 on: June 14, 2018, 07:27:04 PM »
Hi Krmko,
I'm currently using the first method.
different Z transform + perspective camera.
It works fine on my lap top but the UI button didn't work.
Did you happen to know how to solve the problem?

Thanks
M