Hi I was wondering what is better than transform.position for movement, so any input is accepted (no pun intended )
I also want to point out that directly changing transform.position effects how physics work, so thats mainly why im posting.
Hi I was wondering what is better than transform.position for movement, so any input is accepted (no pun intended )
I also want to point out that directly changing transform.position effects how physics work, so thats mainly why im posting.
I use transform.Translate to move my character. I dont know if it is the best way but it works well for me
Code Example: C#
private float speed = 20f;
void Update()
{
if(Input.GetKey(KeyCode.D)) //get input
{
transform.Translate(Vector3.right * speed * Time.deltaTime); //move the character to the right while 'D' is pressed
}
}