android - Unity - input latency is way too high but game has decent frame rate -
i implemented input mobile game so: have buttons , have anywhere else on screen. when player touches screen , not button ingame, character jumps. now, implemented using onpointerdown
, onpointerup
sets bool
:
public class jumpinput : monobehaviour { public static bool jump; public void pointerdown() { jump = true; } public void pointerup() { jump = false; } }
if player jumping, checked fixedupdate
method:
if (!movementdisabled && grounded && jumpinput.jump) { //then can jump currentimageindex = 0; animstate = charanimstates.jumpstart; //added again here //zeroing out y axis velocity if had 1 rb2d.velocity = new vector2(rb2d.velocity.x, 0.0f); //until here jump = true; }
as decent frame rates when using post-processing, have no clue why input delayed. require assistance verify if solution "anywhere on screen input" viable performancewise , not, how improve it.
wiki
Comments
Post a Comment