![]() You can then call the Move function of humanoid with this value. Local direction = cf.LookVector * X + cf.RightVector * Z To get the direction vector that you want, you would times these two vectors by X and Z respectively, and add them together, like so: There is also RightVector which is offset from the cameras cframe by 1 stud to the right.Ĭf.RightVector is functionally the same as (cf*CFrame.new(1,0,0)).p-cf.p LookVector gives you a vector which is offset from the cameras cframe by 1 stud forwards.Ĭf.LookVector is functionally the same as (cf*CFrame.new(0,0,-1)).p-cf.p Unless you change the character’s network ownership to the server, you aren’t going to be able to stop speed hackers. ![]() Return uis:IsKeyDown(movements) and true or false Note: if anyone’s wondering how I decided the input: local movez = 0 I’m not sure whether it should be updated on the client or on the server, because the client could hack it and do a speed hack but on the server the client will see input lag if there connection is slow (>5ms which is kinda crazy) I’m wondering about how I would go about moving the character (note: This will be first person so no third person stuff to worry about), so that it moves in the direction of the camera and desired inputs and feels like the default movement system?Īll I know is I might need to use this: local direction = ![]() Where if you press W for example it will be set to 1 and if you release it will be 0, if you press S it will go to -1, and same for movex where A is -1. I have two variables that change with inputs: movez = 0 I’m trying to re-create custom movement that feels like the default one, but for the purpose that all the controls can be customised and changed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |