Hi everyone, I need some help, Please.
First then all, I’m using the current beta version (2018.3.0b5), because I need Nested Prefabs.
The problem is: My game is working very well, I have no FPS drop, but when I try to set a gameobject layer I lost a bunch of frames.
Here is the Code:
private IEnumerator GoUp (float velocity)
{
vehicle = PreviousBlock.vehicle;
if (m_command != COMMAND.NONE)
{
if (vehicle != null)
{
//m_buttonRenderer.gameObject.layer = vehicle.joystickID + 13;
Game.Instance.SetNewFixedUpdate(CustomFixedUpdate);
}
}
if (m_itemBox != null)
{
m_itemBox.Active();
}
int count = m_renderes.Length;
for (int i = 0; i < count; i++)
{
m_renderes[i].enabled = true;
}
float lerp = 0.0f;
while (lerp < 1.0f)
{
lerp += Game.DELTA_TIME * velocity;
transform.localPosition = Vector3.Lerp(m_offPosition, m_onPosition, lerp);
yield return null;
}
moment = MOMENT.STOPPED_UP;
m_trail.activedBlocks++;
}
I’m doing it at 12 cubes, in different moments, its not on a heavy update or something like it. Without the line my game is working great, but with it the game cannot be played.
Someone knows what could be happening?
Here is some Gifs: