Hi.
I added this coed to my object in the scene, but it can’t move my object to right.
void Update ()
{
transform.position = new Vector2 (5f * Time.deltaTime, transform.position.y);
}
where is the problem?
Hi.
I added this coed to my object in the scene, but it can’t move my object to right.
void Update ()
{
transform.position = new Vector2 (5f * Time.deltaTime, transform.position.y);
}
where is the problem?
Hi,
you forgot to add the value to the previous value of transform.position.x:
void Update ()
{
transform.position = new Vector2 (transform.position.x + (5f * Time.deltaTime), transform.position.y);
}
yes, I forgot to add value to the previous value of transform.position.x.
i mistake it with transform.Translate ().
Thanks a lot.