Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would i get my part to move in the direction its facing? [closed]

Asked by 3 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.
01local dronefacing
02 
03function droneMovement(player,keypressed,direction)
04    if keypressed == "w" then
05        Bodypos.Position = Bodypos.Position + Vector3.new(0,0,-1)
06 
07 
08    elseif keypressed == "a" then
09        Bodypos.Position = Bodypos.Position + Vector3.new(-1,0,0)
10 
11 
12    elseif keypressed == "s" then
13        Bodypos.Position = Bodypos.Position + Vector3.new(0,0,1)
14 
15    elseif  keypressed == "d" then
View all 40 lines...

Closed as Non-Descriptive by JesseSong

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 3 years ago

I recommend using LookVector, RightVector or UpVector https://scriptinghelpers.org/questions/14747/what-is-lookvector-and-how-do-i-use-it

0
Yes ik but is it better to use in the if direction statement or the if keypressed statement? chuba143 -3 — 3y
Ad