Hi, i am developing for mobile.
My game is not that big but it feels like it’s not so smooth either.
I lower my texture to normal size.
I reduce the sound quality and make it compressed.
My scripts are well written i guess, i almost don’t use Update function and if i do, i am not using
expensive functions there.
The quality of the game set to lowest.
This is a 2D game.
I have alot of bricks ( approximatley 100) per scene. All are static objects.
And few lightpoints with culling mask that cover the bricks and the background.
Agreed with methos5k, everything looks good. Is that connected to the mobile version? Could you elaborate on what you mean by “it doesn’t feel smooth”, maybe you’re doing other things incorrectly like not using delta time or using a very low fixed timestep interval.
Hmm, I am using the profiler on the pc.
It feels less smooth in stage that there are more bricks and lights.
I’ll show u where i use delta time and fixed update maybe it is the problem.
FixedUpdate:
public void Moves()
{
if (Manager.WhosPlaying == WhoAmI)
{
transform.position = new Vector3(transform.position.x + MoveSpeed * dirAcc * Time.deltaTime, transform.position.y, transform.position.z);
}
}
I thought about something tell me if it’s a good idea.
Should i make a sprite of 20 bricks instead one?
Maybe it would be better because the use of the materials.
And i changed the material to mobile diffuse for the bricks but the i stayed with the same material for Background and players.
Any good idea for background instead of a big picture?
You should profile a build on the target platform, rather than in the editor, because the performance characteristics between the two are often significantly different.
Here are a few resources that should help you to get started with the Unity Profiler.
Thanks for the help.
But i need to understand how can that is even possible that a little game does not work smooth and a big game of a big company does.
So lets say my problem is the shaders, i won’t use shaders? i’ll always work with low texture and low quality?
It’s weird. There has to be a solution instead of just profiling.
Don’t move the cam in the physics update. You might be grabbing wrong information of your follow transform.
Move it in Update or even better, move it in LateUpdate when everything else has been moved / calculated, as your camera’s transform information may rely on these values.
Guys the Camera move just fine, everything works fine with the movement.
The thing is the game it self not working fine. Sometimes it does but when the scene becoming heavier the game running slower.
It’s still something you should fix. It doesn’t make alot of sense to move the camera in the physics update and you’re potentially grabbing outdated information.
I’m not saying this is the evil part in your particular case, but it’s certainly something one should keep in mind. Just put camera logic in LateUpdate to avoid lagging behind / having jittery/shaky effects.
Other than that, if you’re not just having a jittery camera and instead, you’re facing actual performance problems, you have to provide a little more information.
I don’t have any idea about the smaller size, sorry.
However, for the not running well in general, I can only imagine as others have pointed out is that you should profile it on your target device, and when it’s “heavier”. If then you don’t understand what the profiler says, ask for more help with more information provided. The last screenshot showed that the device had plenty of “free time”.
I use transform.position to move the player.
I am not using rb if that what you asked.
So if i understand you right, it is better for me to move the movement to late update because i don’t use physics for that?