Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is there a lua-equivalent to Unity's "GetAxis()"?

Hello,

I am trying to recreate a script that was previously made in C#. The problem is that Unity has different functions than Roblox Studio has, so implementation is a bit of a challenge. During the implementation, I came across "Input.GetAxis("Horizontal")" which returns the virtual x axis value, and I cannot find a similar thing in Roblox. Is there one that is close?

Thanks!

1 comment

0

Try using this : https://developer.roblox.com/en-us/api-reference/function/UserInputService/GetMouseDelta. I can find this as close as what your described in your question. I know the horizontal input in Unity and X Input of mouse is different. but, this can be an example.

1 answer

Do you mean x position? If so then read the parts x position like this:

part.Position.X

1 comment

0

also trust me, i know how challenging it is to convert another language to roblox lua. i recently recreated classic cookie clicker, which uses html, css, and ALOT of javascript

This discussion is preserved as it was. New answers, comments, and votes are closed.