Platform Scroll Animation for Other Objects Sliding - 2D Game

I want to add platform scroll animation just for visual effect purpose. Because I have started moving platform objects using Physics.

But now I want to add some animation for the ground platform so that moving objects will look more natural.

Here is the platform for that I want to add scroll effect or animation:
4906469--474923--platform_scroll_animation.PNG

Please give me some idea to implement this :slight_smile:

i’m fairly certain you can mess with camera position to get screen scrolling but havent done it myself

Basically, this is a platformer game and the camera is following the player.
I just want an object to be itself play a scrolling animation :slight_smile:

What do you mean by “animation for the ground platform”? Do you want to make the ground animate?

If you are referring to having the background images scroll by as you move left/right on your platform, you can look up Parallax Scrolling (this one helped me a ton):

1 Like

No, this does not background related scrolling.
I want to scroll grills those exist in the platform, I have designed better image to explain you exactly my point:

4910051--475319--platform_grid_scrolling1.png

1 Like

I see. Ok yes, that helps understand what you want to achieve. So if you want this to be constantly moving all the time, you can probably set up a simple animation using the Animation tab.

You can try the following:

Set up the Animation Tab:

  • Open up the Animation tab (right-click on Project tab > Add Tab > Animation).
  • Select the object you want to animate (in this case the ground “grills”).
  • Click on “Create new animation”.
  • Enter a name and select a folder.
  • Add a duration for the animation on the little “0” next to the controls (like in this example).
  • You can add 120 for 2 seconds. Make sure to click outside that box so it registers your change.

Record a Simple Moving Animation:

  • Click on the 0:00 min mark (first mark as shown here for example, this image is not using 2 secs but pretend it is)
  • Click the “Record” button.
  • Then select a different time mark (like 5 miliseconds in for example, as shown on the prev image)
  • Then move the object you want moving, just slightly.
  • Then select another time mark, and move the object again.
  • You keep doing this until you have a few frames for the object moving.
  • When done, click “Record” again to stop recording.

Play & Adjust Animation:

  • Hit “Play” and watch the animation.
  • If you want to slow down the animation, enter less samples (default 60, so enter like 30), and try again.
  • If you want to start over, you can go to the 0:00 min mark and start recording again.

A few comments:

  • This is a very rudimentary way of animating an object.
  • Animations are usually done outside of Unity (specially on characters), but this is a simple workaround if you need just want a quick change of how things look like.
  • Not sure if this will look like what you need, but play around w it and see what comes out.
  • If you need a step by step video on how to do this, I can probably do one later at home, I just didn’t do it here since I am at work and don’t have Unity with me.

Let me know if this helps! :slight_smile:

1 Like

Were you able to make this work?