Problems when translating from C# to Visual Script

Hello, I’m new to programming and I tried to translate from C# to Visual Scripting, but the movement goes from 0 to 2 in the target position. I ran the code and it works correctly, but I don’t understand what I did wrong. Could you correct me if necessary?


This doesn’t explain what is wrong.

Just had a quick look at it and I think it might be from

Vector3 target = new Vector3((targetPosition - 1) * 2, transform.position.y, transform.position.z);

But in the graph you seem to not be setting y and z.

Not sure why you would use visual script if you can write c# though.

Hello, I’m new to Unity. I created the C# script with ChatGPT because I wanted to translate it to Visual Scripting (I find it easier). I was practicing by making an endless runner, and I tried to figure out how to move between 3 lanes on the X axis. As far as I know, I already fixed it and it’s working correctly.