How would i get my part to move in the direction its facing? [closed]
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.
03 | function droneMovement(player,keypressed,direction) |
04 | if keypressed = = "w" then |
05 | Bodypos.Position = Bodypos.Position + Vector 3. new( 0 , 0 ,- 1 ) |
08 | elseif keypressed = = "a" then |
09 | Bodypos.Position = Bodypos.Position + Vector 3. new(- 1 , 0 , 0 ) |
12 | elseif keypressed = = "s" then |
13 | Bodypos.Position = Bodypos.Position + Vector 3. new( 0 , 0 , 1 ) |
15 | elseif keypressed = = "d" then |
16 | Bodypos.Position = Bodypos.Position + Vector 3. new( 1 , 0 , 0 ) |
23 | if direction = = "Right" then |
24 | drone.CFrame = CFrame.new(Bodypos.Position, CFrame.Angles(math.rad( 1 , 0 , 0 ))) |
27 | if direction = = "Left" then |
28 | drone.CFrame = CFrame.new(Bodypos.Position, CFrame.Angles( 0 , 0 ,math.rad(- 1 ))) |
31 | local dronefacing = drone.CFrame.LookVector |
40 | droneserver.OnServerEvent:Connect(droneMovement) |