Page 1 of 1

How to write a script that will move my player in the direction in which I look?

Posted: Mon Dec 10, 2018 8:38 pm
by MartaLabieniec
Hey Guys.
That's me again. I am stuck with something different.

My idea is: Move the Player for about 2 metres in X and Z only pos. where you are pointing the cursor / when you are looking at the moment.

So I found all cords of my player - X, Y and Z - I can move my player to any cord that I want but... how to write a script that when I press ONE BUTTON, it will move my player for 2 metres for example in the direction in which I look.

I am thinking that I must somehow connect X and Z pos. in one script but I don't know how to do it.

I was trying to find any tutorials about it, but there isn't any tutorials about it :-(

Please help me guys.
Thanks.

Re: How to write a script that will move my player in the direction in which I look?

Posted: Thu Dec 20, 2018 4:26 pm
by SunBeam
You need to learn math/physics first. Then coding. Then we talk.

Re: How to write a script that will move my player in the direction in which I look?

Posted: Thu Dec 20, 2018 10:25 pm
by predprey
Perhaps this would be of some use to you.
[Link]