Forum begins after the advertisement:
[Part 5] Static objects twitch
Home › Forums › Video Game Tutorial Series › Creating a Metroidvania in Unity › [Part 5] Static objects twitch
- This topic has 9 replies, 3 voices, and was last updated 10 months ago by
Алексей Буйлов.
-
AuthorPosts
-
April 20, 2024 at 11:49 pm #14051::
Good evening. This is the problem: static objects twitch, for example, which is clearly visible in the video, part of a column in the background. How to fix it?
View post on imgur.com
April 21, 2024 at 1:40 am #14061::Thanks for posting the video Alexus. You can set the player character’s Rigidbody2D to Interpolate, and that can possibly fix the issue.
Here’s an article that explains this phenomenon with more details: https://blog.terresquall.com/2021/12/fix-jittery-camera-movement-in-unity-with-rigidbody-interpolate/
Let me know if this does / doesn’t work.
April 21, 2024 at 3:28 am #14063April 21, 2024 at 1:24 pm #14064::Sorry Alexus, I don’t know which static object you’re referring to that is twitching in the video. Do you mean that the animations for the static objects (e.g. grass) are twitchy?
April 21, 2024 at 4:27 pm #14083::Mostly only parts of the column in the background are twitching, the grass is ok. https://drive.google.com/file/d/1ymJ-PWyw_0sar0a_4vYUor0u839wjiSY/view?usp=drive_link
April 21, 2024 at 11:28 pm #14126::I see what you are talking about now. Do you have multiple sprites on the same Z-axis? If you do, separate them a little bit. If they are overlapping, then the flickering will appear because they are competing to be drawn.
April 22, 2024 at 2:42 am #14130::I moved them apart a little and the flickering disappeared, thank you. Is it possible to somehow get rid of flickering, its objects are superimposed on each other in cases where this is necessary for design?
April 23, 2024 at 10:23 pm #14223::A quick question: I accidentally opened the development environment in this form, how can I get it back?
View post on imgur.com
April 25, 2024 at 3:44 pm #14263::Sorry for the late response, but i’m unsure of whether this is an intentional outcome or accidental. As in, the placement of the diagonal column is below the map, but could it be functioning normally/as intended in the game view? Or it’s placement in the 3d/perspective view is far on the z axis to appear differently on the camera?
April 25, 2024 at 7:20 pm #14267::Sorry for missing your posts Alexus.
Is it possible to somehow get rid of flickering, its objects are superimposed on each other in cases where this is necessary for design?
You can use the Sorting Layer or Order in Layer properties on the Sprite Renderer to specify which sprites should be rendered first. This should fix the flickering issue.
Otherwise, you can separate objects very slightly on the Z-axis, e.g. -9.99 for one sprite, and -9.98 for the sprite that is supposed to be in front of it.
A quick question: I accidentally opened the development environment in this form, how can I get it back?
Go to Window > Layout and Reset the editor layout. This part of our video talks about it (timestamped for you):
April 25, 2024 at 11:19 pm #14286 -
AuthorPosts
- You must be logged in to reply to this topic.
Advertisement below: