Dodge Block – Help

Updated on February 11, 2019 in General
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
4 on February 9, 2019

I finished the tutorial for dodge block but now i want to convert the player movement from pc to mobile, how can i achieve this, below is the following code of how the player moves

*This player movement is very very smooth on pc, so i’m looking for the same smoothness once converted to mobile*

 

float x = Input.GetAxis(“Horizontal”) * Time.fixedDeltaTime * speed;

Vector2 newPos = rb.position + Vector2.right * x;

newPos.x = Mathf.Clamp(newPos.x, -mapWidth, mapWidth); rb.MovePosition(newPos);

 

Thanks!

  • Liked by
  • abdulr
Reply
0 on February 9, 2019

Anyone?

  • Liked by
Reply
Cancel
0 on February 10, 2019

BUMP

 

  • Liked by
Reply
Cancel
0 on February 11, 2019

What are you asking?

All you said is you want to “convert the player movement from pc to mobile”

What does that mean? Are you using motion controls? Virtual joysticks? Touch and drag? GPS? Voice? BT controller?

  • Liked by
Reply
Cancel
0 on February 11, 2019

I would suggest looking up how to implement touch controls (if you are talking about touch input) and starting from there. You can then mess around with how it feels once you have it going.

  • Liked by
Reply
Cancel