Hello, I am wondering if there is anyone who is willing to help an aspiring programmer such as myself. I am trying to setup Pointer Down to work continuously while user is holding down button? I have read lots of posts, watched too many videos and tried lots of ideas but cannot seem to get it to work right.
I have event trigger scripted but I only get movement with my object when pressed rather than when held. I would like my object to be able to move continuously while user is holding down the touch buttons I have in the game.
I have included some of the code used to help create my movement. Thank you in advance for any time you take to look and respond.
void FixedUpdate ()
{
rb.AddForce(0, 0, fowardForce * Time.deltaTime);
transform.Translate(0, 0, Time.deltaTime * 1);
}
public void MoveLeft()
{
rb.AddForce(-sidewaysForce * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
Debug.Log(this.gameObject.name + " Was Clicked.");
}
public void MoveRight()
{
rb.AddForce(sidewaysForce * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
Debug.Log(this.gameObject.name + " Was Clicked.");
}
public void MoveStop()
{
rb.AddForce(0, 0, 0, ForceMode.Impulse);
Debug.Log(this.gameObject.name + " Was Clicked.");
}