- Home /
why ragged ( not smooth) movement....hlp plz
hi guys , ive got a problem that....... my prefab cant move smooth in many computers and my computer too my game is too simple it contains 15 drawcalls and 7 mb for pictures , and its Unusual , ghat my prefab stops for a time and then start moving from some step farther, this is my code for this simple linear movement , please help me if you know why this prolem happens thanx and more than thanx
function Update ()
{
if (c <=5)
{
c += 0.83 * Time.deltaTime;
q1 = CalculateSlowTankBombBezierPoint(c, FixStartSmoothMovement, EndPointForSmoothMovement);
q0 = q1;
transform.position = q1 ;
}
}
function CalculateSlowTankBombBezierPoint(t : float , P0 : Vector3 , P1 : Vector3):Vector3
{
var u : float ;
var p : Vector3 ;
u = 1 - t ;
p= u * P0 ;
p += t * P1 ;
return p ;
}
Answer by alternativevisual · Jun 17, 2017 at 04:34 PM
For smooth movement, use Vector3.Lerp(v1, v2, Time.deltaTime * smooth (1 - too smooth, 15 - ok));
Pictures? Use Power Of Two size (Like 1024x1024, 256x512, etc.), and Unity automatically compress it. Btw, you should to use mipmap texturing (Generate Mipmaps in inspector), it's reduce size of textures with distance.