playMaker

Author Topic: Screen Shake issue  (Read 1070 times)

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Screen Shake issue
« on: April 18, 2021, 02:02:57 PM »
Hello,

I am using the screen shake action from the ecosystem browser. I can get an object in my scene to shake, but when I try to apply it to the camera, it will either not work, or it will put my camera in a weird position, but not shake. There's not an FSM to show because it is just a single action. Any help would be appreciated. Thanks!

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Screen Shake issue
« Reply #1 on: April 19, 2021, 11:32:19 AM »
Bump

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Screen Shake issue
« Reply #2 on: April 20, 2021, 07:30:01 AM »
Hi.
Is your camera following something?

if so make a parent, then drop in the camera and let the parent follow the player.
Then do shake on the camera, on the end of the shake you might want to move back to the local 0,0,0

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Screen Shake issue
« Reply #3 on: April 22, 2021, 09:12:09 AM »
Honestly, my camera is not following anything. It is just one screen. It is a cut scene with moving images on that one screen. Would your advice change if this is the case? Thanks!

John Bassi

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Screen Shake issue
« Reply #4 on: April 22, 2021, 09:21:10 AM »
The camera looks like this in the editor. As you can see the camera is moved but stuck in the same position. It is kind of weird, as I've gotten it to work before, but in a different situation. I looked at that previous example, but it doesn't seem to help. Thanks!

John Bassi

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Screen Shake issue
« Reply #5 on: April 22, 2021, 09:42:38 AM »
here's how I have it currently set:

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Screen Shake issue
« Reply #6 on: April 22, 2021, 06:40:49 PM »
Hi.
I just tested both shake 2d and 3d and they do not work if directly on the camera.

Make an empty object and set the camera as a child.

Then do the shake on the empty object, then it should work.

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Screen Shake issue
« Reply #7 on: April 23, 2021, 01:26:15 PM »
That worked! Thanks! Just one other question. Sometimes when I use the shake action in a 2d game, it shows it through the Z axis. It only does this when I shake it to a certain degree, but sometimes I want it to shake more, but it shows through the Z axis. Any way to shake it more with it still staying fully 2d? Thanks!

John Bassi

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Screen Shake issue
« Reply #8 on: April 25, 2021, 11:01:32 AM »
HI.
On the Sprite Renderer Component you have 2 variables :
Sorting layer and Order in layer.

if 2 objects that are overlapping have the same Sorting layer and Order in layer,
then this can happen.

for sorting layer set layers for groups like background/enemies/dropitems/foreground etc.

then within the groups you can use the 'Order in Layer' which is also important.
for example if you would have 4 enemies and they are overlapping each other and they have the same Sorting layer and Order in layer, they might start to get a 'Ghost effect' (become transparant)
if the order in layer are different this will not happen